Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ADDRESSORG_CHANGE HELP DON'T WORK

0 Kudos
2,007

DATA: objtype LIKE bapi4001_1-objtype,
          obj_id LIKE bapi4001_1-objkey,
          obj_id_ext LIKE bapi4001_1-extension,
          context LIKE bapi4001_1-context,
          address_number LIKE adrc-addrnumber,
          bapiadtel LIKE bapiadtel OCCURS 0 WITH HEADER LINE,
          bapiadtelx LIKE bapiadtelx OCCURS 0 WITH HEADER LINE,
           return LIKE bapiret2 OCCURS 0,
           bapiadsmtp LIKE  bapiadsmtp OCCURS 0 WITH HEADER LINE,
           BAPIADSMTX like BAPIADSMTX occurs 0 with header line,
           bapiad1vl LIKE bapiad1vl OCCURS 0 WITH HEADER LINE,
             bapiad1vlx LIKE bapiad1vlx OCCURS 0 WITH HEADER LINE.




   SELECT SINGLE * FROM lfa1 WHERE stcd1 = zfialtap-stcd1.
   objtype = 'LFA1'.
   obj_id =  lfa1-lifnr.
   obj_id_ext = ' '.
   context = '001'.


CALL FUNCTION 'BAPI_ADDRESSORG_GETDETAIL'

   EXPORTING

     obj_type                   = objtype
     obj_id                     = obj_id
       OBJ_ID_EXT                 = obj_id_ext
       CONTEXT                    = context
*      IV_CURRENT_COMM_DATA       = 'X'
IMPORTING
    ADDRESS_NUMBER             = address_number
TABLES
       BAPIAD1VL                  = BAPIAD1VL
*   BAPIADTEL                  = bapiadtel
*      BAPIADFAX                  =
*      BAPIADTTX                  =
*      BAPIADTLX                  =
*      BAPIADSMTP                 =
*      BAPIADRML                  =
*      BAPIADX400                 =
*      BAPIADRFC                  =
*      BAPIADPRT                  =
*      BAPIADSSF                  =
*      BAPIADURI                  =
*      BAPIADPAG                  =
*      BAPIAD_REM                 =
*      BAPICOMREM                 =
*      BAPIADUSE                  =

       RETURN                     =  RETURN

           .

objtype = 'LFA1'.
   obj_id =  lfa1-lifnr.
   obj_id_ext = ' '.
   context = '001'.

****************direccion*****************************+++

   LOOP AT bapiad1vl.
   bapiad1vl-sort1 = zfialtap-sort1.
   bapiad1vlx-sort1 = 'X'.
   bapiad1vl-str_suppl3 = zfialtap-str_suppl3.
   bapiad1vlx-str_suppl3 = 'X'.
   bapiad1vl-house_no = zfialtap-house_num1.
   bapiad1vlx-house_no = 'X'.
   bapiad1vl-location = zfialtap-location.
   bapiad1vlx-location = 'X'.
   bapiad1vl-district = zfialtap-city2.
   bapiad1vlx-district = 'X'.
   bapiad1vl-home_city = zfialtap-location.
   bapiad1vlx-home_city = 'X'.
   bapiad1vl-house_no2 = zfialtap-house_num2.
   bapiad1vlx-house_no2 = 'X'.
   bapiad1vlx-updateflag = 'U'.
APPEND BAPIAD1VLX.
MODIFY BAPIAD1VL.
ENDLOOP.
*
COMMIT WORK.
*

   CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'
     EXPORTING
       obj_type                          = objtype
       obj_id                            = obj_id
      obj_id_ext                        = ' '
      context                           = '001'
*   ACCEPT_ERROR                      = 'X'
*      SAVE_ADDRESS                      = 'X'
*      IV_CHECK_ADDRESS                  = 'X'
*      IV_TIME_DEPENDENT_COMM_DATA       = ' '
   IMPORTING
      address_number                    = address_number
   TABLES
       BAPIAD1VL                         = BAPIAD1VL
*       BAPIADTEL                         = BAPIADTEL
*      BAPIADFAX                         =
*      BAPIADTTX                         =
*      BAPIADTLX                         =
*        bapiadsmtp                        =  bapiadsmtp
*      BAPIADRML                         =
*      BAPIADX400                        =
*      BAPIADRFC                         =
*      BAPIADPRT                         =
*      BAPIADSSF                         =
*      BAPIADURI                         =
*      BAPIADPAG                         =
*      BAPIAD_REM                        =
*      BAPICOMREM                        =
*      BAPIADUSE                         =
       BAPIAD1VL_X                       =  bapiad1vlx
*       BAPIADTEL_X                       = bapiadtelx
*      BAPIADFAX_X                       =
*      BAPIADTTX_X                       =
*      BAPIADTLX_X                       =
*      BAPIADSMT_X                       = BAPIADSMTX
*      BAPIADRML_X                       =
*      BAPIADX40_X                       =
*      BAPIADRFC_X                       =
*      BAPIADPRT_X                       =
*      BAPIADSSF_X                       =
*      BAPIADURI_X                       =
*      BAPIADPAG_X                       =
*      BAPIAD_RE_X                       =
*      BAPICOMRE_X                       =
*      BAPIADUSE_X                       =
      return                            = return  .


   CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    .

I need  to update date of  direcction  in the  transaction xk01  but  I can  to do ..

Pleas  help  me  thansk

1 ACCEPTED SOLUTION

0 Kudos
852

Hi... all

I can do it ...  the  answare it's  here ...

http://http://sap4.com/wiki/index.php?title=BAPI_ADDRESSORG_GETDETAIL

thank´s   allot ... 

5 REPLIES 5

Sijin_Chandran
Active Contributor
0 Kudos
852

Hi Isabel ,

What is the problem you are facing ?

What are the messages which are returned by BAPI ?

0 Kudos
852

Hi Sijin

If I  debugger  the  program   The bapi   update the  address  into the  transaction XK01, but if If I run the program as user, not upgrading.

Please you can  help me??

Maybe I'm doing something wrong.

Thank you allot.

Issa

0 Kudos
852

Hi Isabel.

Why have you commented the import parameter

SAVE_ADDRESS                      = 'X'   

?

Former Member
0 Kudos
852

Hi Isabel,

There seems to be no problem with the callling of the BAPI just few changes needs to be done.

Can you try to remove the following from your Code.

bapiad1vlx-updateflag = 'U'.

Also , remove the Commit Work before calling the 'BAPI_ADDRESSORG_CHANGE'.

Please try and let us know.

Please refer the below calling parameters.

   CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'
    EXPORTING
      OBJ_TYPE             = LC_OBJ_TYPE
      OBJ_ID               = LV_OBJ_ID

    IMPORTING
      ADDRESS_NUMBER       = LV_ADDR_NO
    TABLES
      BAPIAD1VL            = LT_AD1VL
      BAPIAD1VL_X          = LT_AD1VL_X
      RETURN               = LT_RETURN.

Regards,

Amit

    

0 Kudos
853

Hi... all

I can do it ...  the  answare it's  here ...

http://http://sap4.com/wiki/index.php?title=BAPI_ADDRESSORG_GETDETAIL

thank´s   allot ...