Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

problem in bapi

Former Member
0 Kudos

hi,

my item table is not getting populated.below is my code...

itab delaration:

data:it_item type BAPI2017_GM_ITEM_CREATE occurs 0 with header line,

im moving data from flat file to internal table and then populating it_item using

loop at itab.

move: itab-pdate to it_header-PSTNG_DATE,

itab-ddate to it_header-DOC_DATE.

APPEND it_header.

move: itab-matnr to it_item-MATERIAL,

itab-plant to it_item-PLANT,

itab-stloc to it_item-STGE_LOC,

itab-mtype to it_item-MOVE_TYPE,

itab-quant to it_item-ENTRY_QNT,

itab-rplan to it_item-MOVE_PLANT,

itab-rsloc to it_item-MOVE_STLOC.

APPEND it_item.

when i pass this it_item to my bapi FM. it_item is not populated....

can anyone help....

regards

mano

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

What is the structure of itab? if this is the table containing the flat file, then the code will not work since itab will not have any structure.

You will have to split the file into proper format and then do your loop.

Shruthi

5 REPLIES 5

Former Member
0 Kudos

Hi,

What is the structure of itab? if this is the table containing the flat file, then the code will not work since itab will not have any structure.

You will have to split the file into proper format and then do your loop.

Shruthi

0 Kudos

hi,

this is my structure for itab.

types: begin of gi_ty,

pdate type BUDAT,

ddate type BLDAT,

matnr type MATNR,

plant type WERKS_D,

stloc type LGORT_D,

mtype type BWART,

quant type ERFMG,

rplan type UMWRK,

rsloc type UMLGO,

end of gi_ty.

should i maintain separate internal table for header and item data..

in my case, it_header is getting populate but it _item is not. is it because im using single itab for them...

regards

mano

Former Member
0 Kudos

Hi ,

Put a breakpoint at the loop and check if data is really getting assigned to it_item.

Shruthi

0 Kudos

ya checked, item data is not getting populated....

regards

mano

0 Kudos

Hi shruthi,

my problem is

i have header & item fields

how will i enter in flat file that header fields & item fields.

thanks in advance.