Type conflict #1

July 14th, 2009

If you assign a field symbols with STANDARD TABLE type, you should never declare the reference with header line cause it will give you error.

WRONG:
DATA: ITAB LIKE BSID OCCURS 0 WITH HEADER LINE.
FIELD-SYMBOLS: <F> TYPE STANDARD TABLE.

It will give error when you do this:
ASSIGN (’ITAB’) TO <F> .

CORRECT:
DATA: ITAB LIKE BSID OCCURS 0.

vera ABAP , ,

User Exits

June 5th, 2009

I got the link from: http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm

well, who knows I might need it later ;)

TITLE: A Short Tutorial on User Exits

Content Author: Abhishek

1. Introduction:

User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

The naming standard of function modules for functionmodule exits is:
EXIT_
<3 digit suffix>

The call to a functionmodule exit is implemented as:
CALL CUSTOMER.-FUNCTION <3 digit suffix>

Example:

The program for transaction VA01 Create salesorder is SAPMV45A Read more…

vera ABAP ,

So what’s the problem?

May 27th, 2009

The doctor suspected there’s something wrong with me, so he instructed me to do some lab test for TORCH, ACA, and other small tests.

We got the result last night, and read there’s nothing wrong with the result. Everything seems to be okay… So what’s the problem? Why do I keep losing my fetus? … and like I said, it’s already my third loss!!!

vera Daily

What causes my reccuring fetal loss?

May 25th, 2009

….and this is gonna be my third…

vera Daily

Material beginning stock

March 19th, 2009

If you go through MB5B, you can see beginning stock, receiving / issuing, and ending stock of a specified material in specified plant / storage location. Now, if you need to get that beginning stock of a specified date, sometimes it becomes quite tricky.  I don’t know if SAP provides any function module to read that beginning stock.. I made several trials but never got a correct result that runs correctly for every material.  So, what I did was turning ST05 and run MB5B to see what it really does in the program. It turned out that the program actually “traceback” the stock from the current condition! It doesn’t read any history table (MARDH or MBEWH). I thought that method will take me forever to get the result, but I was wrong! It turned out to be the fastest way compared with all the other methods I tried by reading the history tables!

Here’s my code to get that beginning stock of a material:

Read more…

vera ABAP

Selecting MKPF-MSEG

March 11th, 2009

Selecting data from MKPF and MSEG can be quite tricky.. It will take forever to get just a few rows if you make the wrong selection.

Before you select anything from the table, you need to make sure your selections are in the table’s indexes and make as many conditions possible to restrict an exhaustive selection from the database.

I tried using select in select, get the mkpf in an internal table and then getting the mseg using for all entries, all took a long time… it just didn’t work the way I wanted to be.

And here’s my latest code as an example, and I’m satisfied with it.

Read more…

vera ABAP

Dynamic Internal Table

February 27th, 2009

REPORT YVERA_DYNAMICTABLE .

DATA: D_REF TYPE REF TO DATA,
D_REF2 TYPE REF TO DATA ,
I_ALV_CAT TYPE TABLE OF LVC_S_FCAT,
LS_ALV_CAT LIKE LINE OF I_ALV_CAT.

TYPES TABNAME LIKE DCOBJDEF-NAME .
PARAMETER: P_TABLEN TYPE TABNAME.

DATA: BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE DNTAB.
DATA: END OF ITAB.

FIELD-SYMBOLS : <F_FS> TYPE TABLE,
<F_FS1> TYPE TABLE,
<F_FS2> TYPE ANY,
<F_FS3> TYPE TABLE.

REFRESH ITAB.
CALL FUNCTION ‘NAMETAB_GET’
EXPORTING
LANGU          = SY-LANGU
TABNAME        = P_TABLEN
TABLES
NAMETAB        = ITAB
EXCEPTIONS
NO_TEXTS_FOUND = 1.
LOOP AT ITAB .
LS_ALV_CAT-FIELDNAME = ITAB-FIELDNAME.
LS_ALV_CAT-REF_TABLE = P_TABLEN.
LS_ALV_CAT-REF_FIELD = ITAB-FIELDNAME.
APPEND LS_ALV_CAT TO I_ALV_CAT.
ENDLOOP.
* internal table build
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING IT_FIELDCATALOG = I_ALV_CAT
IMPORTING EP_TABLE = D_REF .
ASSIGN D_REF->* TO <F_FS>.

SELECT * FROM (P_TABLEN) INTO CORRESPONDING FIELDS OF TABLE <F_FS>.

LOOP AT <F_FS> ASSIGNING <F_FS2>.
write:/ <f_fs2>.
*your code goes here.
ENDLOOP.

vera ABAP

Are we living in a real world?

February 26th, 2009

I just read my friend’s blog, what interests me was the picture.. and it was so true! Lol.. I can’t stop laughing. Here’s the pic: 24w7ed0Read this too: Pecas-ndahe, and you’ll see what I’m talking about..

So… are we living in a real world?

vera Daily

Taman Safari. The Indonesian Safari

February 25th, 2009

I went to Taman Safari last Saturday (Feb 21st, 2009) with my family. We started at 6 am from home, arrived there at about 8.20. The road was not crowded like it usually is on weekends, it’s great..

Before we arrived to the place, we bought a few carrots for feeding the animals. The price was Rp 2500 each tie and we bought 4 ties. When we get there it was still closed. So we wait in line for a few minutes with the other cars.

The gate was open at 9.00 (On Sundays it opens at 8.30), the entrance tickets price was Rp 165.000 for 3 people (Adrian was not counted). First we saw a few bunch of elephants standing in a group.. then we found zebra, deer, cow, buffalo, etc.: all the herbivores animals. dsc000691They were not afraid of us, instead they approached us and put their head near the window hoping we’d give them food. So we gave them the carrots one by one. Adrian was so excited. He kept saying “I dare to touch them! I’m brave.. I’m brave…”. Yea right, he kept saying that to deny that he’s actually a bit scared of them.

dsc00080A few kilometers ahead we found another gate. This time we were getting into the carnivores’ place. There were lions, tigers, white tigers, leopard, etc. We had to shut our windows tight, shouldn’t stop and kept moving. They were so beautiful! The Safari must had been taken care of them real good, they were all clean, fresh, even they’re living in a “cage”. Actually what was so called cage was real big with all the artificial habitat, but I think it was almost like a real one. Read more…

vera Daily

Social networking

February 24th, 2009

I have some social networking accounts such as friendster, orkut, yahoo 360, facebook, multiply and you name it what else. I knew most of them cause my friends asked me to join and connect with them.

The first social networking I joined was Friendster. I knew it from my friend in 2004. That was the very first time I joined any social networking. I was actually a bit paranoid at that time, I didn’t dare to put my clear picture there, or anything that described me too detailed.

Then a few months later another friend of mine asked me to join Orkut. He said that it was better, that it was linked with my gmail account and I forget what other reasons was. So, I signed myself up.

After that, another friend got me into Multiply. When I first used it, I liked it immediately. It was very user-friendly, easy to use, and interesting. I could upload anything easily there, including my photos, blogs, recipes, reviews, etc. I could even easily change the theme with provided templates or with the ones I made myself. I used Multiply longer than my other accounts for that matter. Until one day someone’s post disgusted me and made me put “Blogger’s Code of Conduct” on my page. A few people just have to learn about the ethics of blogging before they post anything!
Read more…

vera Daily