Skip to Content
0
Former Member
Aug 01, 2014 at 11:11 PM

How to create additional Line in file based on condition available as part of ZINVOIC02 Idoc segment

69 Views

Scenario Details:

Receiving Zinvoic02 Idoc in PI. Idoc to file translation creates comma separated file with .csv extn

The logic was kept in such a way that how many E1EDP01 (items) are available in IDoc that many no of records will be created in csv file.

The file logic for some the fields is as below:

No of records InvNumber InvDate CusNumber LineitemDesc Tax1Type Tax1%
for 1st E1EDP01 E1EDK01-BELNR E1EDK03-DATUM E1EDK01-PARTN Populate when E1EDP04/MSKWZ=O2 or O4 with E1EDP19/KTEXT Hardcode when E1EDP04/MSKWZ=O2 or O4 Sum all E1EDP04 /MSATZ when E1EDP04/MSKWZ=O2 or O4 for 2nd E1EDP01 E1EDK01-BELNR E1EDK01-DATUM E1EDK01-PARTN same as above same as above same as above for 3rd E1EDP01 E1EDK01-BELNR E1EDK03-DATUM E1EDK01-PARTN same as above same as above same as above Additional Line to be created when one or more of E1EDP01 is having E1EDP04/MSKWZ = O3 same as above same as above same as above Hardcode "REIM for USE TAX" Hardcode "" Hardcode ""

Now we have got addition requirement to add a new lineitem when tax code is equal to O3 for any of the E1EDP01.

Is it possible to create additional lineitem based on condition. If yes, please share what should be the approach.

How we can create the additional lineitem?

Currently we are using E1EDP01 to do context handling.

The target structure is :

MT_FILE

INVOICE 0..unbounded

InvNumber 0..1

InvDate 0..1

CusNumber 0..1

LineitemDesc 0..1

Tax1Type 0..1

Tax1% 0..1

Attachments

Invoice.JPG (59.9 kB)