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: 
Read only

Changes done in user exit does not remain

Former Member
0 Likes
1,541

Hi

Could someone please assist me. I would like to change certain things on the line of the Finance document when being created.

I'm writing code in a user exit, the enhancement is F180A001, I have then used the exit program ZXF48U01.

I have written the below code, goes through and changes the values but the FI document when created does not have the changes. Can someone please let me know what I'm doing wrong?

LOOP AT RELATION_TAB INTO I_RELATION.

READ TABLE DOC_HEAD_TAB INTO I_DOC_HEAD with key

BUKRS = I_RELATION-BUKRS

BELNR = I_RELATION-BELNR.

.

LOOP AT DOC_ITEM_TAB INTO I_DOC_ITEM

WHERE BUKRS = I_RELATION-BUKRS

AND BELNR = I_RELATION-BELNR

AND GJAHR = I_RELATION-GJAHR.

if I_DOC_ITEM-HKONT = '0000681030'.

I_DOC_ITEM-KOSTL = '1000ZA'.

I_DOC_ITEM-PRCTR = '2000ZA'.

I_DOC_ITEM-SGTXT = 'Text Changed'.

MODIFY RELATION_TAB FROM I_RELATION.

ENDIF.

ENDLOOP.

ENDLOOP.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,414

Hi ,

You project is active and the enhancement is assigned to the project.

Regards,

Prabhu Rajesh

Hi

Could someone please assist me. I would like to change certain things on the line of the Finance document when being created.

I'm writing code in a user exit, the enhancement is F180A001, I have then used the exit program ZXF48U01.

I have written the below code, goes through and changes the values but the FI document when created does not have the changes. Can someone please let me know what I'm doing wrong?

LOOP AT RELATION_TAB INTO I_RELATION.

READ TABLE DOC_HEAD_TAB INTO I_DOC_HEAD with key

BUKRS = I_RELATION-BUKRS

BELNR = I_RELATION-BELNR.

.

LOOP AT DOC_ITEM_TAB INTO I_DOC_ITEM

WHERE BUKRS = I_RELATION-BUKRS

AND BELNR = I_RELATION-BELNR

AND GJAHR = I_RELATION-GJAHR.

if I_DOC_ITEM-HKONT = '0000681030'.

I_DOC_ITEM-KOSTL = '1000ZA'.

I_DOC_ITEM-PRCTR = '2000ZA'.

I_DOC_ITEM-SGTXT = 'Text Changed'.

MODIFY RELATION_TAB FROM I_RELATION.

ENDIF.

ENDLOOP.

ENDLOOP.

Thanks in advance

6 REPLIES 6
Read only

Former Member
0 Likes
1,415

Hi ,

You project is active and the enhancement is assigned to the project.

Regards,

Prabhu Rajesh

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,414

Hi Louis,

First thing to check: Is ur enhancement is assigned to some project.If Yes then is that project active. If not then do these things through CMOD and SMOD transactions.

Second thing did u tried debugging ur code? Check whether control is entering to this exit when u create FI doc(may be some conditions are not satisfying). If entering then check ur logic. If logic is correct then probably ur changes are being over written some where in standard code/some other exit. In this case u have to find out appropriate exit and put the code over there.

Hope this will be helpfull.

Thanks,

Vinod.

Read only

Clemenss
Active Contributor
0 Likes
1,414

Hi Louis,

I don't see the right MODIFY statement


MODIFY RELATION_TAB FROM I_RELATION.

stores values from I_RELATION to RELATION_TAB. But you never change any values in I_RELATION.

What about replacing it with


MODIFY DOC_ITEM_TAB FROM I_DOC_ITEM.

Regards,

Clemens

Read only

Former Member
0 Likes
1,414

Hi

Thanks for the responses. Yes the project is activated, yes when debugging it does enter there.

I think one of my mistakes was that I did not write

"MODIFY DOC_ITEM_TAB FROM I_DOC_ITEM."

Cause the changes were not going into DOC_ITEM_TAB. But I have now done this and made sure changes went into DOC_ITEM_TAB. But now it still does not show in FI document.

I suspect that it is changed later in SAP program. Can anyone verify this?? If this is the case can anyone tell me which user exit can be used so that the changes appear in the FI document???

Thanks in advance

Read only

Former Member
0 Likes
1,414

Hi,

Did you get the answer to your issue? I am having a similar issue now wherein I need to populate the BKPF-XBLNR_ALT field and the DOC_HEAD_TAB does not take the modification.

Thanks in advance for your help.

Read only

Former Member
0 Likes
1,414

Hi ,

I too am having same problem, I wish to modify BSEG_SGTXT, however the CHANGING parameter does not have BSEG_SGTXT and therefore does not allow for modification

Steve