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: 
Read only

i am not getting my first BAPI program please help me

Former Member
0 Likes
785

i am getting short dump... i dont where i was wrong ..please help me and give some explanation

types : BEGIN OF ty_bnka,

         banks type bnka-banks,

         bankl type bnka-bankl,

         banka type bnka-banka,

         ADDRESS TYPE BAPIADDR1,

         END OF ty_bnka.

data :  itab type table of ty_bnka,

         wa type ty_bnka,

         IT_RETURN TYPE BAPIRET2.

CALL FUNCTION 'GUI_UPLOAD'

   EXPORTING

     filename                      = 'D:\practice\ANU.TXT'

     HAS_FIELD_SEPARATOR           = 'X'

   tables

     data_tab                      = itab

           .

IF sy-subrc <> 0.exit.ENDIF.

LOOP AT ITAB into WA.

WA-ADDRESS = WA-BANKA.

CALL FUNCTION 'BAPI_BANK_CREATE'

   EXPORTING

     BANK_CTRY             = WA-banks

    BANK_KEY              = WA-bankl

     BANK_ADDRESS          = WA-ADDRESS

*   BANK_METHOD           =

*   BANK_FORMATTING       =

*   BANK_ADDRESS1         =

*   I_XUPDATE             = 'X'

IMPORTING

*   RETURN                = it_return

*   BANKCOUNTRY           =

*   BANKKEY               =

           .

ENDLOOP.

IF IT_RETURN IS INITIAL.

   WRITE😕 'bank', WA-BANKA ,'is created succesful'.

ELSE.

   WRITE😕 'not succesful'.

ENDIF.

i am getting short dump... i dont where i was wrong ..please help me and give some explanation

types : BEGIN OF ty_bnka,

         banks type bnka-banks,

         bankl type bnka-bankl,

         banka type bnka-banka,

         ADDRESS TYPE BAPIADDR1,

         END OF ty_bnka.

data :  itab type table of ty_bnka,

         wa type ty_bnka,

         IT_RETURN TYPE BAPIRET2.

CALL FUNCTION 'GUI_UPLOAD'

   EXPORTING

     filename                      = 'D:\practice\ANU.TXT'

     HAS_FIELD_SEPARATOR           = 'X'

   tables

     data_tab                      = itab

           .

IF sy-subrc <> 0.exit.ENDIF.

LOOP AT ITAB into WA.

WA-ADDRESS = WA-BANKA.

CALL FUNCTION 'BAPI_BANK_CREATE'

   EXPORTING

     BANK_CTRY             = WA-banks

    BANK_KEY              = WA-bankl

     BANK_ADDRESS          = WA-ADDRESS

*   BANK_METHOD           =

*   BANK_FORMATTING       =

*   BANK_ADDRESS1         =

*   I_XUPDATE             = 'X'

IMPORTING

*   RETURN                = it_return

*   BANKCOUNTRY           =

*   BANKKEY               =

           .

ENDLOOP.

IF IT_RETURN IS INITIAL.

   WRITE😕 'bank', WA-BANKA ,'is created succesful'.

ELSE.

   WRITE😕 'not succesful'.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
750

Hi Swamy,

Please paste the screen shot of the dump here or tell us what exactly is the error message

Read only

0 Likes
750

i got it bro...........

what i did in that is  i didnt pass the structure properly there ...

Read only

Former Member
0 Likes
750

Hi Swamy,

In the above code, I just observed you have commented all the importing parameters including the IT_RETURN. Please uncomment an check how it works. But also let us know the error in the dump you are getting

Read only

Former Member
0 Likes
750

i got answer

Read only

0 Likes
750

Hi,

Its good that you have got the answer. I have not got an opportunity to work on BAPI. Can you share it with me? It would be helpful.

Regards

Purnand