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: 

orders creation from flat file

Former Member
0 Kudos

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

7 REPLIES 7

Clemenss
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Please experts solve my problem.

how to process the header and items inside the loop.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

any other suggestions please experts

Former Member
0 Kudos

This is almost a duplicate of

Please mark either this or the other one as solved; otherwise, I will have to lock one of them.

Rob