Skip to Content

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

change in ship to party and sold to party without affecting name fields

hello expert

i update the field in ship to party and sold to party its work properly but if i update the street, postal code and city in ship to party and telephone number and email id in sold to party its properly changes but other fields are not display like name, name2 if i change telephone number only in sold to party it updated but name field is not displayed which i dont want to update but i want its default name keep in  its area... 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_PARNR-PARTN_ROLE   = 'AG'.
   LS_PARNR-PARTN_NUMB   = '0000100005'.
   LS_PARNR-ITM_NUMBER   = '10'.
   APPEND LS_PARNR TO LT_PARNR.
   CLEAR LS_PARNR.


   LS_PARNRC-DOCUMENT    = '0000101164'.
   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.
    CLEAR LS_PARNRC.

   LS_ADDR-ADDR_NO     = '0000000003'.
   LS_ADDR-STREET      = 'NARAYAN PETH LAXMI ROAD'.
   LS_ADDR-CITY        = 'SONPETH'.
   LS_ADDR-POSTL_COD1  = '411401'.
   LS_ADDR-COUNTRY     = 'IN'.
   LS_ADDR-LANGU       = 'E'.
  APPEND LS_ADDR TO LT_ADDR.
  CLEAR LS_ADDR.

* CLEAR LS_PARNR.
   LS_PARNRC-DOCUMENT    = '0000101164'.
   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.
  CLEAR LS_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.
   CLEAR LS_ADDR.


   CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
     EXPORTING
       SALESDOCUMENT    = '0000101164'
       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        =
     .

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