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: 

How to enter a custom message in EDIDS table without inserting into it?

0 Kudos

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.

4 REPLIES 4

Jelena
Active Contributor

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...

Sandra_Rossi
Active Contributor

Please use the CODE button to format your code + avoid abbreviations that people may not know (STR, PR, PFB...)

Sandra_Rossi
Active Contributor
0 Kudos

Could you explain why you don't use the IDOC message type PREQCR1 ? (it calls BAPI_PR_CREATE and returns all messages)

0 Kudos

Found a solution adding the messages into Idoc_status table in the custom Fm created