Application Development and Automation 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: 

Table not getting updated while executing IHC0 but it does so while executing WE19

manish_malakar0316
Active Participant
1,370

Hello all,

I have a requirement wherein I have to execute transaction IHC0 (which generates an inbound IDOC) and this in turn updates a field DTAWS (instruction key) of the table PAYRQ. This field is already showing in one of the idoc segments but it is not getting populated in the PAYRQ table, hence the requirement.

I have written the code inside an implicit enhancement but the issue is that the field DTAWS is not getting updated. However, on executing WE19 and generating a new idoc, I can see that the table field DTAWS is getting updated, implying that the code is working properly and the control is reaching that part.

I am not sure what I am missing. Below are the complete screenshots for your reference:

1) I right click on a particular line item and click POST.

2) A pop will come up stating that the payment order has been posted. Then on double clicking the line, the 'DIsplay IHC Payment Order' screen comes up. I go to tab 'Admin and ref. documents' and click on refresh button. This shows the external idoc number that has been generated and the payment request number 94809.

3) Now if I go to table PAYRQ, give the key number as 94809 and check field DTAWS, I see that the value is empty.

4) I execute WE19 with the debugger ON and by giving idoc number as 23361123.

A new idoc is created with number 23361124 and payment key 94810. On checking the table, I can see that the DTAWS field is updated with the instruction key value as 01 , which is how the case should be.

This is what is confusing me. It is not getting populated on runtime but it is doing so from WE19.

I have written the implicit enhancement inside a method of class IHC_CL_PROC_IDOC_2_PRQ. The method name is FILL_PAYM_CNTRL. I have attached the code snippet as well.

ENHANCEMENT 1  ZFI_PAYRQ_UPDATE.    "active version

DATA: lt_edidd   TYPE TABLE OF edidd,

     l_str1(20),     l_str2(20),    l_str3(20),    l_str4(2),<    l_str5(20).

IMPORT idoc_data TO lt_edidd FROM MEMORY ID 'IDOC_DATA'.

if lt_edidd IS NOT INITIAL.

READ TABLE lt_edidd INTO DATA(ls_edidd) WITH KEY segnam = 'E1IDBW1'.

IF sy-subrc IS INITIAL.

 CONDENSE ls_edidd-sdata.

SPLIT ls_edidd-sdata AT ';' INTO l_str1 l_str2 l_str3. 

IF l_str3 IS NOT INITIAL. 

CONDENSE l_str3.

  split l_str3 at '' into l_str4 l_str5.

 priv_str_instr-instr_key = l_str4.

 ENDIF.

ENDIF.

endif.

Also I would like to mention that the functional consultant provided the FM exits EXIT_SAPLFBQ1_001 and EXIT_SAPLFBQ1_002 for this requirement. Below is his analysis.

However, the exits were not getting triggered on executing IHC0 or WE19 (Project in CMOD was also activated). So I tried with the my own approach, which is also not working !

Please provide your valuable inputs.

Regards,

Manish

4 REPLIES 4

Sandra_Rossi
Active Contributor
1,120

Comment EDITED after your question EDIT.

You say that after copying IDoc 23361123 via WE19 "a new idoc is created with number 23361124 and payment key 94810".

The original IDoc has payment key 94809, so please confirm that you mean you have changed manually 94809 to 94810 before posting?

Could you show a screenshot of both IDocs where payment key is located? (along with the value)

Did you check the execution log of the IDoc 23361123 ?

Did you debug your custom code, and did you compare what's different between IHC0 and WE19 ?

NB: after your question EDIT, your code is full of <br> on one line.

Sandra_Rossi
Active Contributor
0 Kudos
1,120

Please use the COMMENT button for comments, asking for complements, adding details, replying to a comment or a proposed solution or to the OP question, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

manish_malakar0316
Active Participant
0 Kudos
1,120

The COMMENT button was not showing, only the LIKE, SHARE and ALERT MODERATOR buttons were visible. I had to use the ANSWER button to reply

Sandra_Rossi
Active Contributor
0 Kudos
1,120

You're looking at the wrong place. Look above "Add a Comment":