10-06-2009 7:32 AM
experts
I am having a flat file like below
hd ponumber customer number podate delivery date
it material1 materialtext quantity price plant
it material2 materialtext quantity price plant
it material3 materialtext quantity price plant
hd ponumber customer number podate delivery date
it material1 materialtext quantity price plant
it material2 materialtext quantity price plant
it material3 materialtext quantity price plant
so here hd represents the header data and it represents the item data for the above header.
so in above i am having 2 sales orders data.
the only way that i can distinquish is with the field hd and it ie what is header and what is item.
I want to pass only one set of data to the idoc function to create the order.
so i want to pass the header and relevant item info.
my itab internal table is having all the data in the above format.
loop at itab into waitab.
*at end of field1 " is not working
here i will be populating the header and item data to create one sales order.
endloop.
so please tell me how to pass at a time one set of data ie header data and relevant item data then next time again header and relevant item data. please help
this is similar to below theread, but belwo theread is using po number but here i dont have that sepearation
10-06-2009 7:37 AM
Hi,
I don't see the problem.
Please do not ask basic programming questions here - go to [Vbasic for beginners forum|http://www.google.co.kr/search?hl=de&source=hp&q=Vbasicforbeginners+forum&btnG=Google-Suche&meta=], thank you.
Regards,
Clemens
10-06-2009 1:26 PM
Please experts solve my problem.
how to process the header and items inside the loop.
10-06-2009 1:40 PM
Hi,
Can u on change of PONUMBER command inside the loop.
LOOP AT ITAB INTO WA_ITAB.
ONCHANGE OF PONUMBER.
ENDON.
ENDLOOP.
Please let me know if u need any support.
Regards,
Bysani.
10-06-2009 1:46 PM
thanks vasu for the reply.
here i cannot have the po number because my po number is not unique, i mean for all the orders i can have the same po numbers.
So please let me know other way
10-06-2009 2:35 PM
hd ponumber customer number podate delivery date
it material1 materialtext quantity price plant
it material2 materialtext quantity price plant
it material3 materialtext quantity price plant
hd ponumber customer number podate delivery date
it material1 materialtext quantity price plant
it material2 materialtext quantity price plant
it material3 materialtext quantity price plant
Hi,
Can u try thsi logic.
DATA : L_CNT TYPE I VALUE 1,
ITAB_TEMP AS SAME STARUCTRE OF ITAB.
LOOP AT ITAB INTO WA_ITAB FROM INDEX 1.
IF WA_ITAB+0(2) EQ 'HD'.
L_CNT = L_CNT +1
ENDIF.
IF L_CNT EQ 2
hd ponumber customer number podate delivery date
it material1 materialtext quantity price plant
it material2 materialtext quantity price plant
it material3 materialtext quantity price plant
APPEND THIS DATA TO TEMP TABLE.
ELSEIF L_CNT EQ 3
WE WONT APPEND DATA TO TEMP TABLE.
PROCESS TEMP DATA TO IDOCS.
DELETE ITAB FROM TEMP ITAB . " SO IN ORIGINAL ITAB WE WONT HAVE FIRST ORDER ITEM DETAILS.
REFREST TEMPITAB.
ENDLOOP.
ENDIF.
if u have any further issues u can try while looping itab use sy-tabix appropriately.
Regards,
BSVASU.
10-07-2009 6:37 PM
10-07-2009 6:47 PM