SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module to post doc through FPE1 Tcode

surya_ramireddy
Participant
0 Kudos
896

Hi Experts.

Can you please let mw know the function module used to post doc through FPE1 Tcode in ISU Module?

Regards,

surya

1 ACCEPTED SOLUTION

former_member442034
Active Participant
0 Kudos
214

Hi,

You can try transaction SE93 - Maintain Transaction. There you can enter your transaction code and find the main program for this transaction.

Best regards

View solution in original post

4 REPLIES 4

former_member442034
Active Participant
0 Kudos
215

Hi,

You can try transaction SE93 - Maintain Transaction. There you can enter your transaction code and find the main program for this transaction.

Best regards

0 Kudos
214

Use transaction BAPI to search for appropriate delivered BAPI for this requirement.

BAPI_CTRACDOCUMENT_CREATE is listed there and is the correct FM to use.

0 Kudos
214

Hi

Thanks for your reply.

Can you send me any piece of code if possible?

Regards,

surya

0 Kudos
214

Hi.

Here is my code. The FM not posting any document.

DATA:DOCUMENTHEADER LIKE BAPIDFKKKO,

PARTNERPOSITIONS LIKE BAPIDFKKOP OCCURS 0 WITH HEADER LINE,

DOCUMENTNUMBER LIKE BAPIDFKKKO-DOC_NO,

RETURN LIKE BAPIRET2.

START-OF-SELECTION.

CLEAR:PARTNERPOSITIONS,PARTNERPOSITIONS[].

PARTNERPOSITIONS-COMP_CODE = '0400'.

PARTNERPOSITIONS-CONT_ACCT = '000550116672'.

PARTNERPOSITIONS-MAIN_TRANS = '6000'.

PARTNERPOSITIONS-SUB_TRANS = '3021'.

PARTNERPOSITIONS-DIVISION = '03'.

PARTNERPOSITIONS-DOC_DATE = SY-DATUM.

PARTNERPOSITIONS-POST_DATE = SY-DATUM.

PARTNERPOSITIONS-CURRENCY = 'ZAR'.

PARTNERPOSITIONS-AMOUNT = '1016190'.

PARTNERPOSITIONS-BUSPARTNER = '4999924191'.

PARTNERPOSITIONS-G_L_ACCT = '0008291003'.

PARTNERPOSITIONS-TAX_CODE = 'A1'.

PARTNERPOSITIONS-NET_DATE = SY-DATUM.

PARTNERPOSITIONS-ITEM = '01'.

PARTNERPOSITIONS-CMMT_ITEM = '1103003'.

PARTNERPOSITIONS-FUNDS_CTR = '924320'.

PARTNERPOSITIONS-FUND = 'COJ'.

PARTNERPOSITIONS-FM_ORIG_AREA = '1000'.

PARTNERPOSITIONS-FM_CATEGORY = 'G'.

PARTNERPOSITIONS-CLEAR_REAS = '03'.

PARTNERPOSITIONS-APPL_AREA = 'R'.

APPEND PARTNERPOSITIONS.

CLEAR:DOCUMENTHEADER.

DOCUMENTHEADER-FIKEY = '10021901/SWF'.

DOCUMENTHEADER-DOC_TYPE = 'TC'.

DOCUMENTHEADER-CREATED_BY = SY-UNAME.

DOCUMENTHEADER-DOC_DATE = SY-DATUM.

DOCUMENTHEADER-POST_DATE = SY-DATUM.

DOCUMENTHEADER-CURRENCY = 'ZAR'.

DOCUMENTHEADER-APPL_AREA = 'R'.

DOCUMENTHEADER-DOC_SOURCE_KEY = '01'.

BREAK-POINT.

CALL FUNCTION 'BAPI_CTRACDOCUMENT_CREATE'

EXPORTING

TESTRUN = 'X'

DOCUMENTHEADER = DOCUMENTHEADER

  • COMPLETEDOCUMENT =

  • NET_RECEIVABLES =

IMPORTING

DOCUMENTNUMBER = DOCUMENTNUMBER

RETURN = RETURN

TABLES

PARTNERPOSITIONS = PARTNERPOSITIONS[].

WRITE:/ DOCUMENTNUMBER.