2012 Dec 03 2:33 PM
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
2012 Dec 05 12:27 PM
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'
2012 Dec 04 5:25 AM
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
2012 Dec 04 5:33 AM
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
2012 Dec 04 12:20 PM
So there is no way to change a field from the idoc from that Incoming Function Module or somewhere else before posting it?
Thanks!
2012 Dec 04 12:51 PM
You need to fill the cost center data in Idoc internal table T_DATA (E1ACA3-KOSTL) for the changes to take effect.
2012 Dec 04 1:45 PM
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.
2012 Dec 05 9:04 AM
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.
2012 Dec 04 2:25 PM
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.
2012 Dec 05 12:27 PM
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'