2009 Apr 27 6:12 PM
Hello Experts,
My requirement is : I have sales order data which I extracted from third party system in my internal tables. In the same box I need to create inbound Idocs and then consequently create sales orders.
I have used the function module IDOC_INBOUND_WRITE_TO_DB to create inbound Idocs from Sales Orders data in internal tables. I have populated all the data records with correct PSGNUM and HLEVEL values. My plan is to create inbound idocs with this function module and send those to IDOC_INPUT_ORDERS function module which creates Sales Orders.
If a sales order in the internal table in ABAP program contains only one item, then I am getting correct idocs. But if more than one item exists for a sales order then the line item segments which got repeated in Idoc are having PSGNUM and HLEVEL values as zero when I checked in WE02. As a result the hierarchy from the second item segment is getting disturbed and getting the status 60.
I populated T_EDIDD with data records from IDOC_INBOUND_WRITE_TO_DB.
To the function module IDOC_INPUT_ORDERS, T_EDIDC and T_EDIDD are the input. I observed that in T_EDIDD also the PSGNUM and HLEVEL values are blank.
I am getting Status 60 with message 'EDI: Syntax error in IDoc (segment cannot be identified)' for idocs which have more than one item.
I need to extract sales data from third party and create inbound idocs and create sales orders in one ABAP program only. I need to display corresponding Idoc numbers for the corresponding third party sales order number in a listoutput.
Can anybody please provide inputs?
Regards.
Hello Experts,
My requirement is : I have sales order data which I extracted from third party system in my internal tables. In the same box I need to create inbound Idocs and then consequently create sales orders.
I have used the function module IDOC_INBOUND_WRITE_TO_DB to create inbound Idocs from Sales Orders data in internal tables. I have populated all the data records with correct PSGNUM and HLEVEL values. My plan is to create inbound idocs with this function module and send those to IDOC_INPUT_ORDERS function module which creates Sales Orders.
If a sales order in the internal table in ABAP program contains only one item, then I am getting correct idocs. But if more than one item exists for a sales order then the line item segments which got repeated in Idoc are having PSGNUM and HLEVEL values as zero when I checked in WE02. As a result the hierarchy from the second item segment is getting disturbed and getting the status 60.
I populated T_EDIDD with data records from IDOC_INBOUND_WRITE_TO_DB.
To the function module IDOC_INPUT_ORDERS, T_EDIDC and T_EDIDD are the input. I observed that in T_EDIDD also the PSGNUM and HLEVEL values are blank.
I am getting Status 60 with message 'EDI: Syntax error in IDoc (segment cannot be identified)' for idocs which have more than one item.
I need to extract sales data from third party and create inbound idocs and create sales orders in one ABAP program only. I need to display corresponding Idoc numbers for the corresponding third party sales order number in a listoutput.
Can anybody please provide inputs?
Regards.
2009 Apr 27 6:15 PM
to proces inobund idoc..
60 Error during syntax check of IDoc (inbound)
so find go to user exit or program and correct the syntax and process the below inbound program to create idoc..
Program RBDAPP01 for status 64
Program RBDAGAIE for status 32 and 60 (Edited IDocs)
regards,
Prabhudas
2009 Apr 27 6:19 PM
Hi Prabhudas,
Thankyou for your reply.
But I have to create Inbound Idocs from the ABAP progam first. That is failing as a result of disturbed hierarchy level (HLEVEL) and PSGNUM values.
HLEVEL and PSGNUM are having zeroes from the second line item segment. They are having correct values up to first line item for the same Idoc.
Regards.
2009 Apr 28 7:19 AM
Hi
Try getting the value of the segment number and hierarcy fro the idoc itself and recreate it in the ABAP program.
I am doing a similar one where i use the function module and get the data from what is input input in the idoc.
Display the data for a succesful idoc and get the 2 values from the display and then put that into the ABAP program.
2009 Apr 28 5:04 PM
Hi Anjali,
Thanks for the response.
.
I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
for compatibility: clear administration data of data records
perform data_records_wipe
tables
t_data_records.
FORM DATA_RECORDS_WIPE
TABLES
T_DATA_RECORDS_IN STRUCTURE EDIDD.
LOOP AT T_DATA_RECORDS_IN.
CLEAR: T_DATA_RECORDS_IN-MANDT,
T_DATA_RECORDS_IN-DOCNUM,
T_DATA_RECORDS_IN-SEGNUM,
T_DATA_RECORDS_IN-PSGNUM,
T_DATA_RECORDS_IN-HLEVEL.
modify t_data_records_in.
ENDLOOP.
ENDFORM. " DATA_RECORDS_WIPE
This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
I need to create INBOUND Idocs with the data in ABAP program.
Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
Regards
2009 Apr 29 8:42 AM
2009 Apr 29 12:38 PM
Hi ,
You can use FM IDOC_INBOUND_SINGLE to create inbound Idocs. Mention Idoc type and message type in the control record.
Regards,
Deepthi
2009 Apr 29 5:30 PM
Hi Deepthi,
Thankyou for your reply.
I have made use of that function module also. But no use. IDOC_INBOUND_SINGLE again calls the function module IDOC_INBOUND_WRITE_TO_DB inside.
Is there any other way?
REgards.
2009 Apr 29 5:57 PM
Hi,
Check this sample program.
https://www.sdn.sap.com/irj/sdn/wiki?path=?path=/display/SCM/SCM%2bInbound%2bIdoc%2bProgram
It is in the SCM Code Gallery
cheers
Aveek
2009 Apr 30 2:17 AM
Hi,
You can also refer to the program:
https://www.sdn.sap.com/irj/sdn/wiki?path=?path=/display/ABAP/File%2bto%2bInbound%2bIdoc%2bProgram
cheers
Aveek
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |