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: 

Idoc ACLPAY01 user exit

matias_z
Participant
0 Kudos
382

Hi All,

I'm using the incoming idoc ACLPAY01 with the standard message type ACLPAY and what I need to do at the moment the receiving function module is executed is to adding a cost center (KOSTL) to the E1ACA3 segment based on another field that is already in that segment.

The receiving function module is the standard one IDOC_INPUT_ACLPAY and for doing this I implemented the user exit 032 (EXIT_SAPLACC1_032) and inside the include ZXAXXU06 I added the code for getting the cost center and I added it to the field C_ACCIT-KOSTL.

The problem is that the idoc is created, but the cost center is not there. Do you know what else should I do to make this work? Am I missing something?

Thanks in advance,

Matias

1 ACCEPTED SOLUTION

matias_z
Participant
0 Kudos
171

Finally what I did was to implement an enhancement at the beginning of the FM and there I'm using these FMs for changing the segments of the idoc:

'EDI_DOCUMENT_OPEN_FOR_EDIT'

'EDI_CHANGE_DATA_SEGMENTS'

'EDI_DOCUMENT_CLOSE_EDIT'

8 REPLIES 8

former_member215575
Active Participant
0 Kudos
171

Hi Matias,

Since it is incoming IDoc, the new values added will not appear in the IDoc created by reprocessing. Please check the document posted(Accounting:Invoice in this case) whether cost center is updated or not...

Regards,

Sravan Guduru

nabheetscn
Active Contributor
0 Kudos
171

Hi Matias

The IDOC came with cost center as blank that is why it is not shown you can check the document for the same.

Nabheet

matias_z
Participant
0 Kudos
171

So there is no way to change a field from the idoc from that Incoming Function Module or somewhere else before posting it?

Thanks!

0 Kudos
171

You need to fill the cost center data in Idoc internal table T_DATA (E1ACA3-KOSTL) for the changes to take effect.

matias_z
Participant
0 Kudos
171

Hi Sravan,

Do you know the correct way to fill that table in ther user exit?

I only have the sdata info for that particualr segment to fill in.

0 Kudos
171

psuedo code:

loop at T_DATA in workarea

  case workarea-segnam.

     when 'E1ACA3'.

        move workarea-sdata to (local structure of type E1ACA3).

        "you will have the data (sdata) in structure format(field by field).

        "fill KOSTL field in local structure based on requirement.

         move local structure to workarea-sdata.

         modify T_DATA from workarea index sy-tabix transporting sdata.

         clear local structure.

     when others.

  endcase.

endloop.

check whether T_DATA is populated correctly with cost center into E1ACA3 or not.

matias_z
Participant
0 Kudos
171

What I need to do is to add a value to the cost center (E1ACA3-KOSTL) based on some SAP database tables before posting the idoc.

I think that filling the table T_DATA is for new enhancement segments and the correct way to do this is by filling the c_accit structure.

Anyway, none of the 2 options is working.

matias_z
Participant
0 Kudos
172

Finally what I did was to implement an enhancement at the beginning of the FM and there I'm using these FMs for changing the segments of the idoc:

'EDI_DOCUMENT_OPEN_FOR_EDIT'

'EDI_CHANGE_DATA_SEGMENTS'

'EDI_DOCUMENT_CLOSE_EDIT'