12-27-2018 6:59 AM
Hi Experts,
I'm using BAPI_IDOC_INPUT1 code as reference to create a Custom Inbound FM. This Fm is suppose to create a STR from the data received. Now to do that I'm retriving segment data from EDID4 and BAPI_PR_CREATE to create the STR/PR. but I want to show the message recevied from this BAPI in the IDOC Status. PFB the code that I have used.
SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; }
READ TABLE idoc_contrl INTO gw_edidc INDEX 1.
SELECT COUNT(*) FROM edids INTO gw_edids-countr WHERE docnum = gw_edidc-docnum.
gw_edids-countr = gw_edids-countr - 1.
LOOP AT it_return INTO wa_return.
gw_edids-statxt = wa_return-message.
gw_edids-docnum = gw_edidc-docnum.
gw_edids-logdat = sy-datum.
gw_edids-logtim = sy-timlo.
gw_edids-countr = gw_edids-countr + 1.
** gw_edids-status = 51."not executing "just tried this line but it always skips this step i dont know why?
INSERT edids FROM gw_edids.
ENDLOOP.
COMMIT WORK AND WAIT.
01-04-2019 10:23 PM
Both BAPI and the actual processing functions (e.g. IDOC_INPUT_ORDERS) fill in IDOC_STATUS table in memory. You need to update status before it's written into database, not afterwards...
01-05-2019 11:02 AM
Please use the CODE button to format your code + avoid abbreviations that people may not know (STR, PR, PFB...)
01-05-2019 12:39 PM
Could you explain why you don't use the IDOC message type PREQCR1 ? (it calls BAPI_PR_CREATE and returns all messages)
03-02-2019 1:34 AM
Found a solution adding the messages into Idoc_status table in the custom Fm created