Skip to Content
0
Apr 15, 2013 at 05:41 AM

Hi i am not get the output for this can any one help please thanks in advance.

21 Views

TYPE-POOLS truxs.

**********data Declaration**********

DATA : wa_bank_ctry LIKE bapi1011_key-bank_ctry,

bank_key LIKE bapi1011_key-bank_key,

bank_address LIKE bapi1011_address,

v_error LIKE bapiret2,

bankcountry LIKE bapi1011_key-bank_ctry,

bankkey LIKE bapi1011_key-bank_key.

DATA : BEGIN OF wa_data,

bank_ctry LIKE bapi1011_key-bank_ctry,

bank_key LIKE bapi1011_key-bank_ctry,

bank_name LIKE bapi1011_address-bank_name,

city LIKE bapi1011_address-city,

bank_branch LIKE bapi1011_address-bank_branch,

END OF wa_data.

DATA : it_data LIKE TABLE OF wa_data.

DATA : it_raw TYPE truxs_t_text_data.

PARAMETERS : p_file TYPE rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

* DYNPRO_NUMBER = SYST-DYNNR

field_name = 'P_FILE'

IMPORTING

file_name = p_file

.

START-OF-SELECTION.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

* I_FIELD_SEPERATOR =

* I_LINE_HEADER =

i_tab_raw_data = it_raw

i_filename = p_file

TABLES

i_tab_converted_data = it_data

* EXCEPTIONS

* CONVERSION_FAILED = 1

* OTHERS = 2

.

IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT it_data INTO wa_data.

MOVE-CORRESPONDING wa_data TO bank_address.

CALL FUNCTION 'BAPI_BANK_CREATE'

EXPORTING

bank_ctry = wa_bank_ctry

bank_key = bank_key

bank_address = bank_address

* BANK_METHOD =

* BANK_FORMATTING =

* BANK_ADDRESS1 =

IMPORTING

return = v_error

bankcountry = bankcountry

bankkey = bankkey

.

IF v_error IS INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

* EXPORTING

* WAIT =

* IMPORTING

* RETURN =

.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

MESSAGE 'TRANSACTION NOT SUCC' TYPE 'E'.

ENDIF.

ENDLOOP.