Skip to Content
author's profile photo Former Member
Former Member

BAPI_CTRACDOCUMENT_CHANGE - Payment Method Update

Hi Friends,

I need to update Payment Method (field PYMET) in table DFKKOP.
I am using BAPI_CTRACDOCUMENT_CHANGE to do this.

I have passed below data into the BAPI

Import parameters

Document Number

Tables

PMNT_METH in PARTNERPOSITIONS
and PMNT_METH = X in PARTNERPOSITIONSX.

But the table DFKKOP is not getting updated with new Payment
Method, and the BAPI Return parameter is not giving any message.

Please guide me to solve this problem.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jun 04, 2014 at 11:26 AM

    Hi Dipin,

    BAPI_CTRACDOCUMENT_CHANGE uses the Function module FKK_DOCUMENT_CHANGE to update the documents. Put a break-point at FKK_DOCUMENT_CHANGE in this BAPI and check the SY-SUBRC value.

    Also, I assume that you are executing BAPI_TRANSACTION_COMMIT after using the BAPI.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2014 at 09:58 AM

    Hi Dipin,


    You can use below code for the updation of PYMET field from DFKKOP table.



    SELECT * FROM dfkkop INTO TABLE t_dfkkop

    if sy-subrc eq 0.

    LOOP AT t_dfkkop INTO wa_dfkkop.
    wa_dfkkop-pymet = c_i.
    MODIFY t_dfkkop FROM wa_dfkkop TRANSPORTING pymet.
    ENDLOOP.
    MODIFY dfkkop FROM TABLE t_dfkkop.
    IF sy-subrc EQ 0.
    COMMIT WORK.
    ENDIF.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

    • The BAPI suggested by you should serve the purpose, but please remember what so ever the requirement is, never update the standard table...!!!! It is against the SAP compliance, SAP would not support you for inconsistency created through standard table update...!!! I have seen that case in my previous company that is why I am sharing this..!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.