Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

want to change the sold to party telephone and email

hello expert

i want to change the ship to party street,city,postal code and in sold to party change is only telephone number and email id through BAPI_SALESORDER_CHANGE bapi both changes are made but problem is when i change ship to party street, city postal code that same changes also reflect in sold to party which i don't want, i want only telephone number and email id change in sold to party below i mentioned my code

thanks in advance....

REPORT ZDEV_VA01_CHANGE.

tables: BAPISDH1,
         BAPISDH1X,
         BAPISDITM,
         BAPISDITMX,
         BAPIPARNR,
         BAPIPARNRC,
         BAPISCHDL,
         BAPISCHDLX,
         BAPIADDR1.

DATA: LS_HEAD TYPE BAPISDH1,
       LT_HEAD TYPE TABLE OF BAPISDH1,

       LS_HEADX TYPE BAPISDH1X,
       LT_HEADX TYPE TABLE OF BAPISDH1,
       VB LIKE BAPIVBELN-VBELN,

       LS_ITEM TYPE BAPISDITM,
       LT_ITEM TYPE TABLE OF BAPISDITM,

       LS_ITEMX TYPE BAPISDITMX,
       LT_ITEMX TYPE TABLE OF BAPISDITMX,

       LS_SCHDX TYPE BAPISCHDLX,
       LT_SCHDX TYPE TABLE OF BAPISCHDLX,


       LS_PARNR TYPE BAPIPARNR,
       LT_PARNR TYPE TABLE OF BAPIPARNR,

       LS_PARNRC TYPE BAPIPARNRC,
       LT_PARNRC TYPE TABLE OF BAPIPARNRC,

       LS_SCHD TYPE BAPISCHDL,
       LT_SCHD TYPE TABLE OF BAPISCHDL,


       LS_ADDR TYPE BAPIADDR1,
       LT_ADDR TYPE TABLE OF BAPIADDR1,

       LT_BAPIRET2 TYPE TABLE OF BAPIRET2 WITH HEADER LINE.


    START-OF-SELECTION.

      LS_HEAD-SALES_ORG    = 'PRIM'.
      LS_HEAD-DISTR_CHAN   = 'PR'.
      LS_HEAD-DIVISION     = '01'.
     APPEND LS_HEAD TO LT_HEAD.

      LS_HEADX-UPDATEFLAG  = 'U'.
*
*    LS_ITEM-ITM_NUMBER    = '000010'.
*    LS_ITEM-MATERIAL       = '000000000000000015'.
*    LS_ITEM-REASON_REJ      = '60'.
*    APPEND LS_ITEM TO LT_ITEM.
*
*    LS_ITEMX-ITM_NUMBER = 'X'.
*    LS_ITEMX-MATERIAL    = 'X'.
*    LS_ITEMX-REASON_REJ  =  'X'.
*    APPEND LS_ITEMX TO LT_ITEMX.
*
*    LS_SCHD-ITM_NUMBER  = '000010'.
*    LS_SCHD-REQ_QTY     = '20'.
*    LS_SCHD-SCHED_LINE  = '0001'.
*    APPEND LS_SCHD TO LT_SCHD.
*
*    LS_SCHDX-UPDATEFLAG = 'U'.
*    LS_SCHDX-ITM_NUMBER = 'X'.
*    LS_SCHDX-REQ_QTY    = 'X'.
*    LS_SCHDX-SCHED_LINE = 'X'.
*    APPEND LS_SCHDX TO LT_SCHDX.


     LS_PARNRC-DOCUMENT    = '0000101162'.
     LS_PARNRC-UPDATEFLAG  = 'U'.
     LS_PARNRC-PARTN_ROLE  = 'WE'.

     LS_PARNRC-P_NUMB_OLD  = '0000100005'.
     LS_PARNRC-P_NUMB_NEW  = '0000100005'.
     LS_PARNRC-ADDR_LINK   = '0000000003'.
     APPEND LS_PARNRC TO LT_PARNRC.

     LS_ADDR-ADDR_NO     = '0000000003'.
     LS_ADDR-STREET      = 'NARAYAN PETH LAXMI ROAD'.
     LS_ADDR-CITY        = 'PUNE'.
     LS_ADDR-POSTL_COD1  = '411401'.
     LS_ADDR-COUNTRY     = 'IN'.
     LS_ADDR-LANGU       = 'E'.

     APPEND LS_ADDR TO LT_ADDR.

     LS_PARNRC-DOCUMENT    = '0000101162'.
     LS_PARNRC-UPDATEFLAG  = 'U'.
     LS_PARNRC-PARTN_ROLE  = 'AG'.

     LS_PARNRC-P_NUMB_OLD  = '0000100005'.
     LS_PARNRC-P_NUMB_NEW  = '0000100005'.
     LS_PARNRC-ADDR_LINK   = '0000000002'.
     APPEND LS_PARNRC TO LT_PARNRC.

      LS_ADDR-ADDR_NO     = '0000000002'.
      LS_ADDR-E_MAIL      = 'kotalwar.nilesh@gmail.com'.
      LS_ADDR-TEL1_NUMBR  = '8275473215'.
      LS_ADDR-COUNTRY     = 'IN'.
      LS_ADDR-LANGU       = 'E'.
     APPEND LS_ADDR TO LT_ADDR.


    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        SALESDOCUMENT               = '0000101162'
*      ORDER_HEADER_IN             = LS_HEAD
        ORDER_HEADER_INX            = LS_HEADX
*      SIMULATION                  =
*      BEHAVE_WHEN_ERROR           = ' '
*      INT_NUMBER_ASSIGNMENT       = ' '
*      LOGIC_SWITCH                =
*      NO_STATUS_BUF_INIT          = ' '
      TABLES
        RETURN                      = LT_BAPIRET2[]
       ORDER_ITEM_IN               LT_ITEM[]
       ORDER_ITEM_INX              = LT_ITEMX[]
       PARTNERS                    = LT_PARNR[]
       PARTNERCHANGES              = LT_PARNRC[]
       PARTNERADDRESSES            = LT_ADDR[]
*      ORDER_CFGS_REF              =
*      ORDER_CFGS_INST             =
*      ORDER_CFGS_PART_OF          =
*      ORDER_CFGS_VALUE            =
*      ORDER_CFGS_BLOB             =
*      ORDER_CFGS_VK               =
*      ORDER_CFGS_REFINST          =
       SCHEDULE_LINES              = LT_SCHD[]
       SCHEDULE_LINESX             = LT_SCHDX[]
*      ORDER_TEXT                  =
*      ORDER_KEYS                  =
*      CONDITIONS_IN               =
*      CONDITIONS_INX              =
*      EXTENSIONIN                 =
*      EXTENSIONEX                 =
              .


     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*     EXPORTING
*       WAIT          =
*     IMPORTING
*       RETURN        =
               .

Former Member replied

Hi,

    

     Don't pass the P_NUMB_OLD ,P_NUMB_NEW twice.

       LS_PARNRC-DOCUMENT    = '0000101162'.
     LS_PARNRC-UPDATEFLAG  = 'U'.
     LS_PARNRC-PARTN_ROLE  = 'WE'.

     LS_PARNRC-P_NUMB_OLD  = '0000100005'.
     LS_PARNRC-P_NUMB_NEW  = '0000100005'.
     LS_PARNRC-ADDR_LINK   = '0000000003'.
     APPEND LS_PARNRC TO LT_PARNRC.

     LS_ADDR-ADDR_NO     = '0000000003'.
     LS_ADDR-STREET      = 'NARAYAN PETH LAXMI ROAD'.
     LS_ADDR-CITY        = 'PUNE'.
     LS_ADDR-POSTL_COD1  = '411401'.
     LS_ADDR-COUNTRY     = 'IN'.
     LS_ADDR-LANGU       = 'E'.

     APPEND LS_ADDR TO LT_ADDR.

     LS_PARNRC-DOCUMENT    = '0000101162'.
     LS_PARNRC-UPDATEFLAG  = 'U'.
     LS_PARNRC-PARTN_ROLE  = 'AG'.

    LS_PARNRC-P_NUMB_OLD  = '0000100005'.
     LS_PARNRC-P_NUMB_NEW  = '0000100005'.
     LS_PARNRC-ADDR_LINK   = '0000000002'.
     APPEND LS_PARNRC TO LT_PARNRC.

      LS_ADDR-ADDR_NO     = '0000000002'.
      LS_ADDR-E_MAIL      = 'kotalwar.nilesh@gmail.com'.
      LS_ADDR-TEL1_NUMBR  = '8275473215'.
      LS_ADDR-COUNTRY     = 'IN'.
      LS_ADDR-LANGU       = 'E'.
     APPEND LS_ADDR TO LT_ADDR.



remove those two lines



0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question