Skip to Content
avatar image
Former Member

file path and file name?

hi could anyone give code for filename and file path name from application and presentation server....

I need to give file name and file path on selection screen for both the servers....

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Oct 11, 2007 at 10:28 AM

    Hi Abhay,

    Refer to the below code:

    &----


    *& Report ZHYPERION *

    *& *

    &----


    *& Project : SubSea7

    • Created on : 07/02/2007

    • Created by : Puneet Jhari.

    *& Purpose : For SAP Interface download Hyperion.

    &----


    REPORT zhyperion NO STANDARD PAGE HEADING MESSAGE-ID zhyper.

    *----


    • Start of Data Declaration

    *----


    TYPE-POOLS : truxs,vrm.

    TABLES : glpct,cepc.

    DATA : var TYPE i,

    total TYPE f.

    DATA : BEGIN OF wa2,

    ryear LIKE glpct-ryear,

    rbukrs LIKE glpct-rbukrs,

    racct LIKE glpct-racct,

    ksl01 LIKE glpct-ksl01,

    END OF wa2.

    DATA : BEGIN OF wa3,

    ryear LIKE glpct-ryear,

    rbukrs LIKE glpct-rbukrs,

    racct LIKE glpct-racct,

    ksl01 LIKE glpct-ksl01,

    END OF wa3.

    DATA : BEGIN OF wa4,

    racct LIKE glpct-racct,

    END OF wa4.

    DATA : BEGIN OF wa5,

    rbukrs LIKE glpct-rbukrs,

    racct LIKE glpct-racct,

    total1(8) TYPE p DECIMALS 2,

    END OF wa5.

    DATA : BEGIN OF wa9,

    khinr LIKE cepc-khinr,

    racct LIKE glpct-racct,

    total1(8) TYPE p DECIMALS 2,

    END OF wa9.

    DATA : BEGIN OF wa6,

    khinr LIKE cepc-khinr,

    prctr LIKE cepc-prctr,

    rprctr LIKE glpct-rprctr,

    ryear LIKE glpct-ryear,

    rbukrs LIKE glpct-rbukrs,

    racct LIKE glpct-racct,

    ksl01 LIKE glpct-ksl01,

    END OF wa6.

    DATA : BEGIN OF wa7,

    khinr LIKE cepc-khinr,

    prctr LIKE cepc-prctr,

    rprctr LIKE glpct-rprctr,

    ryear LIKE glpct-ryear,

    rbukrs LIKE glpct-rbukrs,

    racct LIKE glpct-racct,

    ksl01 LIKE glpct-ksl01,

    END OF wa7.

    DATA : itab3 LIKE TABLE OF wa2,

    itab4 LIKE TABLE OF wa3,

    itab5 LIKE TABLE OF wa4 WITH HEADER LINE,

    itab6 LIKE TABLE OF wa5 WITH HEADER LINE,

    itab7 LIKE TABLE OF wa6,

    itab8 LIKE TABLE OF wa7,

    itab10 LIKE TABLE OF wa9.

    DATA : flag(1) TYPE c,

    temp(6) TYPE c.

    DATA : itab2 TYPE truxs_t_text_data,

    itab9 TYPE truxs_t_text_data WITH HEADER LINE.

    DATA : name TYPE vrm_id,

    list TYPE vrm_values,

    value LIKE LINE OF list,

    FILNAM11 TYPE STRING,

    FILNAM21 TYPE STRING.

    *----


    • End of Data Declaration

    *----


    *----


    • Begin of Selection Screen

    *----


    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    PARAMETERS: r1 DEFAULT 'X' RADIOBUTTON GROUP g1 USER-COMMAND rad1,

    r2 RADIOBUTTON GROUP g1 .

    SELECTION-SCREEN END OF BLOCK b1.

    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-005.

    PARAMETERS: rbukrs1 TYPE glpct-rbukrs MODIF ID ful,

    khinr1 TYPE cepc-khinr AS LISTBOX VISIBLE LENGTH 20

    MODIF ID sam ,

    ryear1 TYPE glpct-ryear MODIF ID ful,

    ryear2 TYPE glpct-ryear MODIF ID sam,

    rpmax1 TYPE i MODIF ID ful,

    rpmax2 TYPE i MODIF ID sam,

    filnam1 TYPE rlgrap-filename MODIF ID ful,

    filnam2 TYPE RLGRAP-FILENAME MODIF ID sam.

    SELECTION-SCREEN END OF BLOCK b3.

    *----


    • End of Selection Screen

    *----


    *********************************************************************

    • AT SELECTION-SCREEN OUTPUT

    **********************************************************************

    AT SELECTION-SCREEN OUTPUT.

    • PERFORM populate. "For populating the drop-down list.

    CLEAR VALUE.

    REFRESH LIST.

    NAME = 'KHINR1'.

    VALUE-KEY = '1S7_NOCASV'.

    VALUE-TEXT = '1S7_NOCASV'.

    APPEND VALUE TO LIST.

    VALUE-KEY = '1S7_NOCJOT'.

    VALUE-TEXT = '1S7_NOCJOT'.

    APPEND VALUE TO LIST.

    LOOP AT SCREEN. "For toggling between the selection screens.

    IF r1 EQ 'X'.

    IF screen-group1 = 'SAM'.

    screen-active = 0.

    ENDIF.

    ELSEIF r2 EQ 'X'.

    IF screen-group1 = 'FUL'.

    screen-active = 0.

    ENDIF.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    *********************************************************************

    • For the Drop-Down Listbox

    **********************************************************************

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = name

    values = list

    • EXCEPTIONS

    • ID_ILLEGAL_NAME = 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.

    *----


    • Begin of Data Selection

    *----


    START-OF-SELECTION.

    *----


    • When Company Code radio button is selected.

    *----


    IF r1 EQ 'X'. "If Company Code radio button is selected.

    IF rbukrs1 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    IF rpmax1 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    IF ryear1 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    IF filnam1 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    MOVE FILNAM1 TO FILNAM11.

    CASE rpmax1.

    WHEN '01'.

    SELECT ryear rbukrs racct ksl01

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '02'.

    SELECT ryear rbukrs racct ksl02

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '03'.

    SELECT ryear rbukrs racct ksl03

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '04'.

    SELECT ryear rbukrs racct ksl04

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '05'.

    SELECT ryear rbukrs racct ksl05

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '06'.

    SELECT ryear rbukrs racct ksl06

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '07'.

    SELECT ryear rbukrs racct ksl07

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '08'.

    SELECT ryear rbukrs racct ksl08

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '09'.

    SELECT ryear rbukrs racct ksl09

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '10'.

    SELECT ryear rbukrs racct ksl10

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '11'.

    SELECT ryear rbukrs racct ksl11

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '12'.

    SELECT ryear rbukrs racct ksl12

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '13'.

    SELECT ryear rbukrs racct ksl13

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '14'.

    SELECT ryear rbukrs racct ksl14

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '15'.

    SELECT ryear rbukrs racct ksl15

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    WHEN '16'.

    SELECT ryear rbukrs racct ksl16

    FROM glpct INTO TABLE itab3 WHERE rbukrs EQ rbukrs1 AND ryear EQ ryear1.

    ENDCASE.

    MOVE itab3 TO itab4.

    LOOP AT itab3 INTO wa2.

    flag = 0.

    LOOP AT itab5 INTO wa4.

    IF wa2-racct EQ wa4-racct.

    flag = 1.

    EXIT.

    ENDIF.

    ENDLOOP.

    DELETE ADJACENT DUPLICATES FROM itab5.

    IF flag = 1.

    CONTINUE.

    ENDIF.

    LOOP AT itab4 INTO wa3.

    IF wa2-rbukrs EQ wa3-rbukrs AND wa2-racct EQ wa3-racct AND

    wa2-ryear EQ wa3-ryear.

    total = total + wa3-ksl01.

    ENDIF.

    ENDLOOP.

    wa5-rbukrs = wa2-rbukrs.

    wa5-racct = wa2-racct+4(6).

    wa5-total1 = total.

    APPEND wa5 TO itab6.

    CLEAR total.

    APPEND wa2-racct TO itab5.

    ENDLOOP.

    *----


    • If no data is available corresponding to the values entered.

    *----


    IF itab6[] IS INITIAL.

    MESSAGE i003.

    ENDIF.

    *----


    • For making the file Comma separated

    *----


    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'

    EXPORTING

    i_field_seperator = ','

    • I_LINE_HEADER =

    • I_FILENAME =

    • I_APPL_KEEP = ' '

    TABLES

    i_tab_sap_data = itab6

    CHANGING

    i_tab_converted_data = itab2

    • 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.

    *----


    • For downloading it to the Presentation Server

    *----


    • MOVE itab2[] TO itab9[].

    • OPEN DATASET filnam1 FOR OUTPUT IN LEGACY TEXT MODE.

    • LOOP AT itab9.

    • TRANSFER itab9 TO filnam1.

    • ENDLOOP.

    • CLOSE DATASET filnam1.

    • IF sy-subrc EQ 0.

    • MESSAGE s004.

    • ENDIF.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    • BIN_FILESIZE =

    filename = FILNAM11

    • FILETYPE = 'ASC'

    • APPEND = ' '

    • WRITE_FIELD_SEPARATOR = ' '

    • HEADER = '00'

    • TRUNC_TRAILING_BLANKS = ' '

    • WRITE_LF = 'X'

    • COL_SELECT = ' '

    • COL_SELECT_MASK = ' '

    • DAT_MODE = ' '

    • CONFIRM_OVERWRITE = ' '

    • NO_AUTH_CHECK = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • WRITE_BOM = ' '

    • TRUNC_TRAILING_BLANKS_EOL = 'X'

    • WK1_N_FORMAT = ' '

    • WK1_N_SIZE = ' '

    • WK1_T_FORMAT = ' '

    • WK1_T_SIZE = ' '

    • WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE

    • IMPORTING

    • FILELENGTH =

    tables

    data_tab = itab2

    • FIELDNAMES =

    • EXCEPTIONS

    • FILE_WRITE_ERROR = 1

    • NO_BATCH = 2

    • GUI_REFUSE_FILETRANSFER = 3

    • INVALID_TYPE = 4

    • NO_AUTHORITY = 5

    • UNKNOWN_ERROR = 6

    • HEADER_NOT_ALLOWED = 7

    • SEPARATOR_NOT_ALLOWED = 8

    • FILESIZE_NOT_ALLOWED = 9

    • HEADER_TOO_LONG = 10

    • DP_ERROR_CREATE = 11

    • DP_ERROR_SEND = 12

    • DP_ERROR_WRITE = 13

    • UNKNOWN_DP_ERROR = 14

    • ACCESS_DENIED = 15

    • DP_OUT_OF_MEMORY = 16

    • DISK_FULL = 17

    • DP_TIMEOUT = 18

    • FILE_NOT_FOUND = 19

    • DATAPROVIDER_EXCEPTION = 20

    • CONTROL_FLUSH_ERROR = 21

    • OTHERS = 22

    .

    IF sy-subrc eq 0.

    message s004.

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

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

    ENDIF.

    *----


    • When Region radio button is selected.

    *----


    ELSEIF r2 EQ 'X'.

    IF khinr1 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    IF rpmax2 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    IF ryear2 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    IF filnam2 IS INITIAL.

    MESSAGE i002.

    LEAVE TO SCREEN 1000.

    ENDIF.

    MOVE FILNAM2 TO FILNAM21.

    CASE rpmax2.

    WHEN '01'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl01

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '02'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl02

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '03'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl03

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '04'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl04

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '05'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl05

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '06'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl06

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '07'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl07

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '08'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl08

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '09'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl09

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '10'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl10

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '11'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl11

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '12'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl12

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '13'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl13

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '14'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl14

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '15'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl15

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    WHEN '16'.

    SELECT ckhinr cprctr grprctr gryear grbukrs gracct g~ksl16

    INTO CORRESPONDING FIELDS OF TABLE itab7

    FROM ( glpct AS g

    INNER JOIN cepc AS c ON grprctr = cprctr )

    WHERE c~khinr = khinr1 AND

    g~ryear = ryear2.

    ENDCASE.

    MOVE itab7 TO itab8.

    LOOP AT itab7 INTO wa6.

    flag = 0.

    LOOP AT itab5 INTO wa4.

    IF wa6-racct EQ wa4-racct.

    flag = 1.

    EXIT.

    ENDIF.

    ENDLOOP.

    DELETE ADJACENT DUPLICATES FROM itab5.

    IF flag = 1.

    CONTINUE.

    ENDIF.

    LOOP AT itab8 INTO wa7.

    IF wa6-rbukrs EQ wa7-rbukrs AND wa6-racct EQ wa7-racct AND

    wa6-ryear EQ wa7-ryear.

    total = total + wa7-ksl01.

    ENDIF.

    ENDLOOP.

    wa9-khinr = khinr1.

    wa9-racct = wa6-racct+4(6).

    wa9-total1 = total.

    APPEND wa9 TO itab10.

    CLEAR total.

    APPEND wa6-racct TO itab5.

    ENDLOOP.

    *----


    *If no data is available corresponding to the values entered.

    *----


    IF itab10 IS INITIAL.

    MESSAGE i003.

    ENDIF.

    *----


    • For making the file Comma separated

    *----


    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'

    EXPORTING

    i_field_seperator = ','

    • I_LINE_HEADER =

    • I_FILENAME =

    • I_APPL_KEEP = ' '

    TABLES

    i_tab_sap_data = itab10

    CHANGING

    i_tab_converted_data = itab2

    • 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.

    *----


    • For downloading it to the Presentation Server

    *----


    • MOVE itab2[] TO itab9[].

    *

    • OPEN DATASET filnam2 FOR OUTPUT IN LEGACY TEXT MODE.

    • LOOP AT itab9.

    • TRANSFER itab9 TO filnam2.

    • ENDLOOP.

    • CLOSE DATASET filnam2.

    • IF sy-subrc EQ 0.

    • MESSAGE s004.

    • ENDIF.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    • BIN_FILESIZE =

    filename = FILNAM21

    • FILETYPE = 'ASC'

    • APPEND = ' '

    • WRITE_FIELD_SEPARATOR = ' '

    • HEADER = '00'

    • TRUNC_TRAILING_BLANKS = ' '

    • WRITE_LF = 'X'

    • COL_SELECT = ' '

    • COL_SELECT_MASK = ' '

    • DAT_MODE = ' '

    • CONFIRM_OVERWRITE = ' '

    • NO_AUTH_CHECK = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • WRITE_BOM = ' '

    • TRUNC_TRAILING_BLANKS_EOL = 'X'

    • WK1_N_FORMAT = ' '

    • WK1_N_SIZE = ' '

    • WK1_T_FORMAT = ' '

    • WK1_T_SIZE = ' '

    • WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE

    • IMPORTING

    • FILELENGTH =

    tables

    data_tab = itab2

    • FIELDNAMES =

    • EXCEPTIONS

    • FILE_WRITE_ERROR = 1

    • NO_BATCH = 2

    • GUI_REFUSE_FILETRANSFER = 3

    • INVALID_TYPE = 4

    • NO_AUTHORITY = 5

    • UNKNOWN_ERROR = 6

    • HEADER_NOT_ALLOWED = 7

    • SEPARATOR_NOT_ALLOWED = 8

    • FILESIZE_NOT_ALLOWED = 9

    • HEADER_TOO_LONG = 10

    • DP_ERROR_CREATE = 11

    • DP_ERROR_SEND = 12

    • DP_ERROR_WRITE = 13

    • UNKNOWN_DP_ERROR = 14

    • ACCESS_DENIED = 15

    • DP_OUT_OF_MEMORY = 16

    • DISK_FULL = 17

    • DP_TIMEOUT = 18

    • FILE_NOT_FOUND = 19

    • DATAPROVIDER_EXCEPTION = 20

    • CONTROL_FLUSH_ERROR = 21

    • OTHERS = 22

    .

    IF sy-subrc eq 0.

    message s004.

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

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

    ENDIF.

    ENDIF.

    &----


    *& Form POPULATE

    &----


    • text

    ----


    FORM populate.

    CLEAR value.

    REFRESH list.

    name = 'KHINR1'.

    value-key = '1S7_SUBSEA'.

    value-text = '1S7_SUBSEA'.

    APPEND value TO list.

    value-key = '1S7_GEN'.

    value-text = '1S7_GEN'.

    APPEND value TO list.

    value-key = '1S7'.

    value-text = '1S7'.

    APPEND value TO list.

    value-key = '1S7_CORPTP'.

    value-text = '1S7_CORPTP'.

    APPEND value TO list.

    value-key = '1S7_BRRE'.

    value-text = '1S7_BRRE'.

    APPEND value TO list.

    value-key = '1S7_BRCON'.

    value-text = '1S7_BRCON'.

    APPEND value TO list.

    value-key = '1S7_BRCJOB'.

    value-text = '1S7_BRCJOB'.

    APPEND value TO list.

    value-key = '1S7_BRCJBU'.

    value-text = '1S7_BRCJBU'.

    APPEND value TO list.

    value-key = '1S7_BRCJCO'.

    value-text = '1S7_BRCJCO'.

    APPEND value TO list.

    value-key = '1S7_BRCJIR'.

    value-text = '1S7_BRCJIR'.

    APPEND value TO list.

    value-key = '1S7_BRCJEN'.

    value-text = '1S7_BRCJEN'.

    APPEND value TO list.

    value-key = '1S7_BRCJPI'.

    value-text = '1S7_BRCJPI'.

    APPEND value TO list.

    value-key = '1S7_BRCJSU'.

    value-text = '1S7_BRCJSU'.

    APPEND value TO list.

    value-key = '1S7_BRCJFL'.

    value-text = '1S7_BRCJFL'.

    APPEND value TO list.

    value-key = '1S7_BRCJOT'.

    value-text = '1S7_BRCJOT'.

    APPEND value TO list.

    value-key = '1S7_BRCASV'.

    value-text = '1S7_BRCASV'.

    APPEND value TO list.

    value-key = '1S7_BRCASE'.

    value-text = '1S7_BRCASE'.

    APPEND value TO list.

    value-key = '1S7_BRCOOC'.

    value-text = '1S7_BRCOOC'.

    APPEND value TO list.

    value-key = '1S7_BRCOHD'.

    value-text = '1S7_BRCOHD'.

    APPEND value TO list.

    value-key = '1S7_BRCGEN'.

    value-text = '1S7_BRCGEN'.

    APPEND value TO list.

    value-key = '1S7_BRDRI'.

    value-text = '1S7_BRDRI'.

    APPEND value TO list.

    value-key = '1S7_BRDJOB'.

    value-text = '1S7_BRDJOB'.

    APPEND value TO list.

    value-key = '1S7_BRDASV'.

    value-text = '1S7_BRDASV'.

    APPEND value TO list.

    value-key = '1S7_BRDASE'.

    value-text = '1S7_BRDASE'.

    APPEND value TO list.

    value-key = '1S7_BRDAEW'.

    value-text = '1S7_BRDAEW'.

    APPEND value TO list.

    value-key = '1S7_BRDAEO'.

    value-text = '1S7_BRDAEO'.

    APPEND value TO list.

    value-key = '1S7_BRDAET'.

    value-text = '1S7_BRDAET'.

    APPEND value TO list.

    value-key = '1S7_BRDOOC'.

    value-text = '1S7_BRDOOC'.

    APPEND value TO list.

    value-key = '1S7_BRDOHD'.

    value-text = '1S7_BRDOHD'.

    APPEND value TO list.

    value-key = '1S7_BRVER'.

    value-text = '1S7_BRVER'.

    APPEND value TO list.

    value-key = '1S7_BRVJOB'.

    value-text = '1S7_BRVJOB'.

    APPEND value TO list.

    value-key = '1S7_BRVASV'.

    value-text = '1S7_BRVASV'.

    APPEND value TO list.

    value-key = '1S7_BRVASE'.

    value-text = '1S7_BRVASE'.

    APPEND value TO list.

    value-key = '1S7_BRVOOC'.

    value-text = '1S7_BRVOOC'.

    APPEND value TO list.

    value-key = '1S7_BRVOHD'.

    value-text = '1S7_BRVOHD'.

    APPEND value TO list.

    value-key = '1S7_UKRE'.

    value-text = '1S7_UKRE'.

    APPEND value TO list.

    value-key = '1S7_UKCON'.

    value-text = '1S7_UKCON'.

    APPEND value TO list.

    value-key = '1S7_UKCJOB'.

    value-text = '1S7_UKCJOB'.

    APPEND value TO list.

    value-key = '1S7_UKCJBU'.

    value-text = '1S7_UKCJBU'.

    APPEND value TO list.

    value-key = '1S7_UKCJCO'.

    value-text = '1S7_UKCJCO'.

    APPEND value TO list.

    value-key = '1S7_UKCJIR'.

    value-text = '1S7_UKCJIR'.

    APPEND value TO list.

    value-key = '1S7_UKCJEN'.

    value-text = '1S7_UKCJEN'.

    APPEND value TO list.

    value-key = '1S7_UKCJPI'.

    value-text = '1S7_UKCJPI'.

    APPEND value TO list.

    value-key = '1S7_UKCJSU'.

    value-text = '1S7_UKCJSU'.

    APPEND value TO list.

    value-key = '1S7_UKCJFL'.

    value-text = '1S7_UKCJFL'.

    APPEND value TO list.

    value-key = '1S7_UKCJOT'.

    value-text = '1S7_UKCJOT'.

    APPEND value TO list.

    value-key = '1S7_UKCASV'.

    value-text = '1S7_UKCASV'.

    APPEND value TO list.

    value-key = '1S7_UKCASE'.

    value-text = '1S7_UKCASE'.

    APPEND value TO list.

    value-key = '1S7_UKCOOC'.

    value-text = '1S7_UKCOOC'.

    APPEND value TO list.

    value-key = '1S7_UKBA'.

    value-text = '1S7_UKBA'.

    APPEND value TO list.

    value-key = '1S7_UKBATE'.

    value-text = '1S7_UKBATE'.

    APPEND value TO list.

    value-key = '1S7_UKCOHD'.

    value-text = '1S7_UKCOHD'.

    APPEND value TO list.

    value-key = '1S7_UKCGEN'.

    value-text = '1S7_UKCGEN'.

    APPEND value TO list.

    value-key = '1S7_UKDRI'.

    value-text = '1S7_UKDRI'.

    APPEND value TO list.

    value-key = '1S7_UKDJOB'.

    value-text = '1S7_UKDJOB'.

    APPEND value TO list.

    value-key = '1S7_UKDASV'.

    value-text = '1S7_UKDASV'.

    APPEND value TO list.

    value-key = '1S7_UKDASE'.

    value-text = '1S7_UKDASE'.

    APPEND value TO list.

    value-key = '1S7_UKDAEW'.

    value-text = '1S7_UKDAEW'.

    APPEND value TO list.

    value-key = '1S7_UKDAEO'.

    value-text = '1S7_UKDAEO'.

    APPEND value TO list.

    value-key = '1S7_UKDAET'.

    value-text = '1S7_UKDAET'.

    APPEND value TO list.

    value-key = '1S7_UKDOOC'.

    value-text = '1S7_UKDOOC'.

    APPEND value TO list.

    value-key = '1S7_UKDOHD'.

    value-text = '1S7_UKDOHD'.

    APPEND value TO list.

    value-key = '1S7_UKVER'.

    value-text = '1S7_UKVER'.

    APPEND value TO list.

    value-key = '1S7_UKVJOB'.

    value-text = '1S7_UKVJOB'.

    APPEND value TO list.

    value-key = '1S7_UKVASV'.

    value-text = '1S7_UKVASV'.

    APPEND value TO list.

    value-key = '1S7_UKVASE'.

    value-text = '1S7_UKVASE'.

    APPEND value TO list.

    value-key = '1S7_UKVOOC'.

    value-text = '1S7_UKVOOC'.

    APPEND value TO list.

    value-key = '1S7_UKVOHD'.

    value-text = '1S7_UKVOHD'.

    APPEND value TO list.

    value-key = '1S7_NORE'.

    value-text = '1S7_NORE'.

    APPEND value TO list.

    value-key = '1S7_NOCON'.

    value-text = '1S7_NOCON'.

    APPEND value TO list.

    value-key = '1S7_NOCJOB'.

    value-text = '1S7_NOCJOB'.

    APPEND value TO list.

    value-key = '1S7_NOCJBU'.

    value-text = '1S7_NOCJBU'.

    APPEND value TO list.

    value-key = '1S7_NOCJCO'.

    value-text = '1S7_NOCJCO'.

    APPEND value TO list.

    value-key = '1S7_NOCJIR'.

    value-text = '1S7_NOCJIR'.

    APPEND value TO list.

    value-key = '1S7_NOCJEN'.

    value-text = '1S7_NOCJEN'.

    APPEND value TO list.

    value-key = '1S7_NOCJPI'.

    value-text = '1S7_NOCJPI'.

    APPEND value TO list.

    value-key = '1S7_NOCJSU'.

    value-text = '1S7_NOCJSU'.

    APPEND value TO list.

    value-key = '1S7_NOCJFL'.

    value-text = '1S7_NOCJFL'.

    APPEND value TO list.

    value-key = '1S7_NOCJOT'.

    value-text = '1S7_NOCJOT'.

    APPEND value TO list.

    value-key = '1S7_NOCASV'.

    value-text = '1S7_NOCASV'.

    APPEND value TO list.

    value-key = '1S7_NOCASE'.

    value-text = '1S7_NOCASE'.

    APPEND value TO list.

    value-key = '1S7_NOCOOC'.

    value-text = '1S7_NOCOOC'.

    APPEND value TO list.

    value-key = '1S7_NOCOHD'.

    value-text = '1S7_NOCOHD'.

    APPEND value TO list.

    value-key = '1S7_NOCGEN'.

    value-text = '1S7_NOCGEN'.

    APPEND value TO list.

    value-key = '1S7_NODRI'.

    value-text = '1S7_NODRI'.

    APPEND value TO list.

    value-key = '1S7_NODJOB'.

    value-text = '1S7_NODJOB'.

    APPEND value TO list.

    value-key = '1S7_NODASV'.

    value-text = '1S7_NODASV'.

    APPEND value TO list.

    value-key = '1S7_NODASE'.

    value-text = '1S7_NODASE'.

    APPEND value TO list.

    value-key = '1S7_NODAEW'.

    value-text = '1S7_NODAEW'.

    APPEND value TO list.

    value-key = '1S7_NODAEO'.

    value-text = '1S7_NODAEO'.

    APPEND value TO list.

    value-key = '1S7_NODAET'.

    value-text = '1S7_NODAET'.

    APPEND value TO list.

    value-key = '1S7_NODOOC'.

    value-text = '1S7_NODOOC'.

    APPEND value TO list.

    value-key = '1S7_NODOHD'.

    value-text = '1S7_NODOHD'.

    APPEND value TO list.

    value-key = '1S7_NOVER'.

    value-text = '1S7_NOVER'.

    APPEND value TO list.

    value-key = '1S7_NOVJOB'.

    value-text = '1S7_NOVJOB'.

    APPEND value TO list.

    value-key = '1S7_NOVASV'.

    value-text = '1S7_NOVASV'.

    APPEND value TO list.

    value-key = '1S7_NOVASE'.

    value-text = '1S7_NOVASE'.

    APPEND value TO list.

    value-key = '1S7_NOVOOC'.

    value-text = '1S7_NOVOOC'.

    APPEND value TO list.

    value-key = '1S7_NOVOHD'.

    value-text = '1S7_NOVOHD'.

    APPEND value TO list.

    value-key = '1S7_GORE'.

    value-text = '1S7_GORE'.

    APPEND value TO list.

    value-key = '1S7_GOCON'.

    value-text = '1S7_GOCON'.

    APPEND value TO list.

    value-key = '1S7_GOCJOB'.

    value-text = '1S7_GOCJOB'.

    APPEND value TO list.

    value-key = '1S7_GOCJBU'.

    value-text = '1S7_GOCJBU'.

    APPEND value TO list.

    value-key = '1S7_GOCJCO'.

    value-text = '1S7_GOCJCO'.

    APPEND value TO list.

    value-key = '1S7_GOCJIR'.

    value-text = '1S7_GOCJIR'.

    APPEND value TO list.

    value-key = '1S7_GOCJEN'.

    value-text = '1S7_GOCJEN'.

    APPEND value TO list.

    value-key = '1S7_GOCJPI'.

    value-text = '1S7_GOCJPI'.

    APPEND value TO list.

    value-key = '1S7_GOCJSU'.

    value-text = '1S7_GOCJSU'.

    APPEND value TO list.

    value-key = '1S7_GOCJFL'.

    value-text = '1S7_GOCJFL'.

    APPEND value TO list.

    value-key = '1S7_GOCJOT'.

    value-text = '1S7_GOCJOT'.

    APPEND value TO list.

    value-key = '1S7_GOCASV'.

    value-text = '1S7_GOCASV'.

    APPEND value TO list.

    value-key = '1S7_GOCASE'.

    value-text = '1S7_GOCASE'.

    APPEND value TO list.

    value-key = '1S7_GOCOOC'.

    value-text = '1S7_GOCOOC'.

    APPEND value TO list.

    value-key = '1S7_GOCOHD'.

    value-text = '1S7_GOCOHD'.

    APPEND value TO list.

    value-key = '1S7_GOCGEN'.

    value-text = '1S7_GOCGEN'.

    APPEND value TO list.

    value-key = '1S7_GODRI'.

    value-text = '1S7_GODRI'.

    APPEND value TO list.

    value-key = '1S7_GODJOB'.

    value-text = '1S7_GODJOB'.

    APPEND value TO list.

    value-key = '1S7_GODASV'.

    value-text = '1S7_GODASV'.

    APPEND value TO list.

    value-key = '1S7_GODASE'.

    value-text = '1S7_GODASE'.

    APPEND value TO list.

    value-key = '1S7_GODAEW'.

    value-text = '1S7_GODAEW'.

    APPEND value TO list.

    value-key = '1S7_GODAEO'.

    value-text = '1S7_GODAEO'.

    APPEND value TO list.

    value-key = '1S7_GODAET'.

    value-text = '1S7_GODAET'.

    APPEND value TO list.

    value-key = '1S7_GODOOC'.

    value-text = '1S7_GODOOC'.

    APPEND value TO list.

    value-key = '1S7_GODOHD'.

    value-text = '1S7_GODOHD'.

    APPEND value TO list.

    value-key = '1S7_GOVER'.

    value-text = '1S7_GOVER'.

    APPEND value TO list.

    value-key = '1S7_GOVJOB'.

    value-text = '1S7_GOVJOB'.

    APPEND value TO list.

    value-key = '1S7_GOVASV'.

    value-text = '1S7_GOVASV'.

    APPEND value TO list.

    value-key = '1S7_GOVASE'.

    value-text = '1S7_GOVASE'.

    APPEND value TO list.

    value-key = '1S7_GOVOOC'.

    value-text = '1S7_GOVOOC'.

    APPEND value TO list.

    value-key = '1S7_GOVOHD'.

    value-text = '1S7_GOVOHD'.

    APPEND value TO list.

    value-key = '1S7_GVRE'.

    value-text = '1S7_GVRE'.

    APPEND value TO list.

    value-key = '1S7_GVCON'.

    value-text = '1S7_GVCON'.

    APPEND value TO list.

    value-key = '1S7_GVCJOB'.

    value-text = '1S7_GVCJOB'.

    APPEND value TO list.

    value-key = '1S7_GVCJBU'.

    value-text = '1S7_GVCJBU'.

    APPEND value TO list.

    value-key = '1S7_GVCJCO'.

    value-text = '1S7_GVCJCO'.

    APPEND value TO list.

    value-key = '1S7_GVCJIR'.

    value-text = '1S7_GVCJIR'.

    APPEND value TO list.

    value-key = '1S7_GVCJEN'.

    value-text = '1S7_GVCJEN'.

    APPEND value TO list.

    value-key = '1S7_GVCJPI'.

    value-text = '1S7_GVCJPI'.

    APPEND value TO list.

    value-key = '1S7_GVCJSU'.

    value-text = '1S7_GVCJSU'.

    APPEND value TO list.

    value-key = '1S7_GVCJFL'.

    value-text = '1S7_GVCJFL'.

    APPEND value TO list.

    value-key = '1S7_GVCJOT'.

    value-text = '1S7_GVCJOT'.

    APPEND value TO list.

    value-key = '1S7_GVCASV'.

    value-text = '1S7_GVCASV'.

    APPEND value TO list.

    value-key = '1S7_GVCASE'.

    value-text = '1S7_GVCASE'.

    APPEND value TO list.

    value-key = '1S7_GVCOOC'.

    value-text = '1S7_GVCOOC'.

    APPEND value TO list.

    value-key = '1S7_GVCOHD'.

    value-text = '1S7_GVCOHD'.

    APPEND value TO list.

    value-key = '1S7_GVCGEN'.

    value-text = '1S7_GVCGEN'.

    APPEND value TO list.

    value-key = '1S7_GVDRI'.

    value-text = '1S7_GVDRI'.

    APPEND value TO list.

    value-key = '1S7_GVDJOB'.

    value-text = '1S7_GVDJOB'.

    APPEND value TO list.

    value-key = '1S7_GVDASV'.

    value-text = '1S7_GVDASV'.

    APPEND value TO list.

    value-key = '1S7_GVDASE'.

    value-text = '1S7_GVDASE'.

    APPEND value TO list.

    value-key = '1S7_GVDOOC'.

    value-text = '1S7_GVDOOC'.

    APPEND value TO list.

    value-key = '1S7_GVDOHD'.

    value-text = '1S7_GVDOHD'.

    APPEND value TO list.

    value-key = '1S7_GVVER'.

    value-text = '1S7_GVVER'.

    APPEND value TO list.

    value-key = '1S7_GVVJOB'.

    value-text = '1S7_GVVJOB'.

    APPEND value TO list.

    value-key = '1S7_GVVASV'.

    value-text = '1S7_GVVASV'.

    APPEND value TO list.

    value-key = '1S7_GVVASE'.

    value-text = '1S7_GVVASE'.

    APPEND value TO list.

    value-key = '1S7_GVVOOC'.

    value-text = '1S7_GVVOOC'.

    APPEND value TO list.

    value-key = '1S7_GVVOHD'.

    value-text = '1S7_GVVOHD'.

    APPEND value TO list.

    value-key = '1S7_GCRE'.

    value-text = '1S7_GCRE'.

    APPEND value TO list.

    value-key = '1S7_GCCON'.

    value-text = '1S7_GCCON'.

    APPEND value TO list.

    value-key = '1S7_GCCJOB'.

    value-text = '1S7_GCCJOB'.

    APPEND value TO list.

    value-key = '1S7_GCCJBU'.

    value-text = '1S7_GCCJBU'.

    APPEND value TO list.

    value-key = '1S7_GCCJCO'.

    value-text = '1S7_GCCJCO'.

    APPEND value TO list.

    value-key = '1S7_GCCJIR'.

    value-text = '1S7_GCCJIR'.

    APPEND value TO list.

    value-key = '1S7_GCCJEN'.

    value-text = '1S7_GCCJEN'.

    APPEND value TO list.

    value-key = '1S7_GCCJPI'.

    value-text = '1S7_GCCJPI'.

    APPEND value TO list.

    value-key = '1S7_GCCJSU'.

    value-text = '1S7_GCCJSU'.

    APPEND value TO list.

    value-key = '1S7_GCCJFL'.

    value-text = '1S7_GCCJFL'.

    APPEND value TO list.

    value-key = '1S7_GCCJOT'.

    value-text = '1S7_GCCJOT'.

    APPEND value TO list.

    value-key = '1S7_GCCASV'.

    value-text = '1S7_GCCASV'.

    APPEND value TO list.

    value-key = '1S7_GCCASE'.

    value-text = '1S7_GCCASE'.

    APPEND value TO list.

    value-key = '1S7_GCCOOC'.

    value-text = '1S7_GCCOOC'.

    APPEND value TO list.

    value-key = '1S7_GCCOHD'.

    value-text = '1S7_GCCOHD'.

    APPEND value TO list.

    value-key = '1S7_GCCRD'.

    value-text = '1S7_GCCRD'.

    APPEND value TO list.

    value-key = '1S7_GCCGEN'.

    value-text = '1S7_GCCGEN'.

    APPEND value TO list.

    value-key = '1S7_GCDRI'.

    value-text = '1S7_GCDRI'.

    APPEND value TO list.

    value-key = '1S7_GCDJOB'.

    value-text = '1S7_GCDJOB'.

    APPEND value TO list.

    value-key = '1S7_GCDASV'.

    value-text = '1S7_GCDASV'.

    APPEND value TO list.

    value-key = '1S7_GCDASE'.

    value-text = '1S7_GCDASE'.

    APPEND value TO list.

    value-key = '1S7_GCDOOC'.

    value-text = '1S7_GCDOOC'.

    APPEND value TO list.

    value-key = '1S7_GCDOHD'.

    value-text = '1S7_GCDOHD'.

    APPEND value TO list.

    value-key = '1S7_GCVER'.

    value-text = '1S7_GCVER'.

    APPEND value TO list.

    value-key = '1S7_GCVJOB'.

    value-text = '1S7_GCVJOB'.

    APPEND value TO list.

    value-key = '1S7_GCVASV'.

    value-text = '1S7_GCVASV'.

    APPEND value TO list.

    value-key = '1S7_GCVASE'.

    value-text = '1S7_GCVASE'.

    APPEND value TO list.

    value-key = '1S7_GCVOOC'.

    value-text = '1S7_GCVOOC'.

    APPEND value TO list.

    value-key = '1S7_GCVOHD'.

    value-text = '1S7_GCVOHD'.

    APPEND value TO list.

    value-key = '1S7_APRE'.

    value-text = '1S7_APRE'.

    APPEND value TO list.

    value-key = '1S7_APCON'.

    value-text = '1S7_APCON'.

    APPEND value TO list.

    value-key = '1S7_APCJOB'.

    value-text = '1S7_APCJOB'.

    APPEND value TO list.

    value-key = '1S7_APCJBU'.

    value-text = '1S7_APCJBU'.

    APPEND value TO list.

    value-key = '1S7_APCJCO'.

    value-text = '1S7_APCJCO'.

    APPEND value TO list.

    value-key = '1S7_APCJIR'.

    value-text = '1S7_APCJIR'.

    APPEND value TO list.

    value-key = '1S7_APCJEN'.

    value-text = '1S7_APCJEN'.

    APPEND value TO list.

    value-key = '1S7_APCJPI'.

    value-text = '1S7_APCJPI'.

    APPEND value TO list.

    value-key = '1S7_APCJSU'.

    value-text = '1S7_APCJSU'.

    APPEND value TO list.

    value-key = '1S7_APCJFL'.

    value-text = '1S7_APCJFL'.

    APPEND value TO list.

    value-key = '1S7_APCJOT'.

    value-text = '1S7_APCJOT'.

    APPEND value TO list.

    value-key = '1S7_APCASV'.

    value-text = '1S7_APCASV'.

    APPEND value TO list.

    value-key = '1S7_APCASE'.

    value-text = '1S7_APCASE'.

    APPEND value TO list.

    value-key = '1S7_APCOOC'.

    value-text = '1S7_APCOOC'.

    APPEND value TO list.

    value-key = '1S7_APCOHD'.

    value-text = '1S7_APCOHD'.

    APPEND value TO list.

    value-key = '1S7_APCGEN'.

    value-text = '1S7_APCGEN'.

    APPEND value TO list.

    value-key = '1S7_APDRI'.

    value-text = '1S7_APDRI'.

    APPEND value TO list.

    value-key = '1S7_APDJOB'.

    value-text = '1S7_APDJOB'.

    APPEND value TO list.

    value-key = '1S7_APDASV'.

    value-text = '1S7_APDASV'.

    APPEND value TO list.

    value-key = '1S7_APDASE'.

    value-text = '1S7_APDASE'.

    APPEND value TO list.

    value-key = '1S7_APDAEW'.

    value-text = '1S7_APDAEW'.

    APPEND value TO list.

    value-key = '1S7_APDAEO'.

    value-text = '1S7_APDAEO'.

    APPEND value TO list.

    value-key = '1S7_APDAET'.

    value-text = '1S7_APDAET'.

    APPEND value TO list.

    value-key = '1S7_APDOOC'.

    value-text = '1S7_APDOOC'.

    APPEND value TO list.

    value-key = '1S7_APDOHD'.

    value-text = '1S7_APDOHD'.

    APPEND value TO list.

    value-key = '1S7_APVER'.

    value-text = '1S7_APVER'.

    APPEND value TO list.

    value-key = '1S7_APVJOB'.

    value-text = '1S7_APVJOB'.

    APPEND value TO list.

    value-key = '1S7_APVASV'.

    value-text = '1S7_APVASV'.

    APPEND value TO list.

    value-key = '1S7_APVASE'.

    value-text = '1S7_APVASE'.

    APPEND value TO list.

    value-key = '1S7_APVOOC'.

    value-text = '1S7_APVOOC'.

    APPEND value TO list.

    value-key = '1S7_APVOHD'.

    value-text = '1S7_APVOHD'.

    APPEND value TO list.

    value-key = '1S7_WARE'.

    value-text = '1S7_WARE'.

    APPEND value TO list.

    value-key = '1S7_WACON'.

    value-text = '1S7_WACON'.

    APPEND value TO list.

    value-key = '1S7_WACJOB'.

    value-text = '1S7_WACJOB'.

    APPEND value TO list.

    value-key = '1S7_WACJBU'.

    value-text = '1S7_WACJBU'.

    APPEND value TO list.

    value-key = '1S7_WACJCO'.

    value-text = '1S7_WACJCO'.

    APPEND value TO list.

    value-key = '1S7_WACJIR'.

    value-text = '1S7_WACJIR'.

    APPEND value TO list.

    value-key = '1S7_WACJEN'.

    value-text = '1S7_WACJEN'.

    APPEND value TO list.

    value-key = '1S7_WACJPI'.

    value-text = '1S7_WACJPI'.

    APPEND value TO list.

    value-key = '1S7_WACJSU'.

    value-text = '1S7_WACJSU'.

    APPEND value TO list.

    value-key = '1S7_WACJFL'.

    value-text = '1S7_WACJFL'.

    APPEND value TO list.

    value-key = '1S7_WACJOT'.

    value-text = '1S7_WACJOT'.

    APPEND value TO list.

    value-key = '1S7_WACASV'.

    value-text = '1S7_WACASV'.

    APPEND value TO list.

    value-key = '1S7_WACASE'.

    value-text = '1S7_WACASE'.

    APPEND value TO list.

    value-key = '1S7_WACOOC'.

    value-text = '1S7_WACOOC'.

    APPEND value TO list.

    value-key = '1S7_WACOHD'.

    value-text = '1S7_WACOHD'.

    APPEND value TO list.

    value-key = '1S7_WACGEN'.

    value-text = '1S7_WACGEN'.

    APPEND value TO list.

    value-key = '1S7_WADRI'.

    value-text = '1S7_WADRI'.

    APPEND value TO list.

    value-key = '1S7_WADJOB'.

    value-text = '1S7_WADJOB'.

    APPEND value TO list.

    value-key = '1S7_WADASV'.

    value-text = '1S7_WADASV'.

    APPEND value TO list.

    value-key = '1S7_WADASE'.

    value-text = '1S7_WADASE'.

    APPEND value TO list.

    value-key = '1S7_WADAEW'.

    value-text = '1S7_WADAEW'.

    APPEND value TO list.

    value-key = '1S7_WADAEO'.

    value-text = '1S7_WADAEO'.

    APPEND value TO list.

    value-key = '1S7_WADAET'.

    value-text = '1S7_WADAET'.

    APPEND value TO list.

    value-key = '1S7_WADOOC'.

    value-text = '1S7_WADOOC'.

    APPEND value TO list.

    value-key = '1S7_WADOHD'.

    value-text = '1S7_WADOHD'.

    APPEND value TO list.

    value-key = '1S7_WAVER'.

    value-text = '1S7_WAVER'.

    APPEND value TO list.

    value-key = '1S7_WAVJOB'.

    value-text = '1S7_WAVJOB'.

    APPEND value TO list.

    value-key = '1S7_WAVASV'.

    value-text = '1S7_WAVASV'.

    APPEND value TO list.

    value-key = '1S7_WAVASE'.

    value-text = '1S7_WAVASE'.

    APPEND value TO list.

    value-key = '1S7_WAVOOC'.

    value-text = '1S7_WAVOOC'.

    APPEND value TO list.

    value-key = '1S7_WAVOHD'.

    value-text = '1S7_WAVOHD'.

    APPEND value TO list.

    ENDFORM. "POPULATE

    In case you have any further clarifications,do let me know.

    Regards,

    Puneet Jhari.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 10:28 AM

    Hi,

    You can use FM F4_FILENAME to fetch the file from the presentation server,

    regards,

    Niyaz

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 10:31 AM

    Hi,

    Try like this

    PARAMETERS : p_lpn TYPE filename-pathintern

    DEFAULT c_lpn OBLIGATORY , "Logical Path Name

    p_aserv RADIOBUTTON GROUP grp

    USER-COMMAND app, "Application server

    p_afile1 TYPE filename-fileextern , "Application File

    "Name for contracts

    p_afile2 TYPE filename-fileextern , "Application

    "FileName for

    "Long text

    p_aerfl1 TYPE filename-fileextern , "Error File

    "forcontracts

    p_aerfl2 TYPE filename-fileextern , "Error File

    "for Longtext

    p_pserv RADIOBUTTON GROUP grp, "Presentation Server

    p_pfile1 TYPE rlgrap-filename , "Presentation File

    "Name forcontracts

    p_pfile2 TYPE rlgrap-filename , "Presentation File

    "Name for long

    "texts

    p_errfl1 TYPE rlgrap-filename ,

    "Error File for

    "contracts

    p_errfl2 TYPE rlgrap-filename . "Err File Long text

    AT SELECTION-SCREEN OUTPUT.

    • Subroutine for appearance of the selection screen

    PERFORM screen.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pfile1.

    • This subroutine is used to get the input for presentation server file

    • name. It gives a popup wherein we can select the file from the

    • presentation server.

    PERFORM getfilename CHANGING p_pfile1.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pfile2.

    • This subroutine is used to get the input for presentation server file

    • name. It gives a popup wherein we can select the file from the

    • presentation server.

    PERFORM getfilename CHANGING p_pfile2.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_errfl1.

    • This subroutine is used to get the input for presentation server file

    • name. It gives a popup wherein we can select the file from the

    • presentation server.

    PERFORM getfilename CHANGING p_errfl1.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_errfl2.

    • This subroutine is used to get the input for presentation server file

    • name. It gives a popup wherein we can select the file from the

    • presentation server.

    PERFORM getfilename CHANGING p_errfl2.

    &----


    *& Form getfilename

    &----


    • It displays the f4 help for presentation server file name *

    • User can select the file from presentation server *

    ----


    • <--PV_file Input file name *

    ----


    FORM getfilename CHANGING pv_file TYPE rlgrap-filename.

    CALL FUNCTION 'WS_FILENAME_GET' "#EC *

    EXPORTING

    def_filename = space

    def_path = space

    mask = space

    mode = space

    title = space

    IMPORTING

    filename = pv_file

    EXCEPTIONS

    inv_winsys = 1

    no_batch = 2

    selection_cancel = 3

    selection_error = 4

    OTHERS = 5.

    IF sy-subrc <> 0 AND sy-subrc <> 3.

    MESSAGE i134.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " getfilename

    &----


    *& Form validate_screen

    &----


    • Subroutine to validate the selection-screen entries

    ----


    FORM validate_screen .

    IF p_aserv EQ c_x.

    • This perform generate the physical path using

    • file_get_name function module.

    PERFORM get_physical_file.

    ENDIF.

    IF p_pserv = c_x.

    MOVE p_pfile1 TO v_fname1.

    MOVE p_pfile2 TO v_fname2.

    ENDIF.

    ENDFORM. " validate_screen

    &----


    *& Form get_physical_file

    &----


    • Subroutine to get the physical file name

    ----


    FORM get_physical_file .

    *--Call the function module to get the physical file name for the

    • logical file path provided.

    DATA: lv_mandt LIKE sy-mandt,

    lv_opsys LIKE sy-opsys.

    MOVE: sy-mandt TO lv_mandt,

    sy-opsys TO lv_opsys.

    CALL FUNCTION 'FILE_GET_NAME'

    EXPORTING

    client = lv_mandt

    logical_filename = p_lpn

    operating_system = lv_opsys

    IMPORTING

    file_name = v_fname1

    EXCEPTIONS

    file_not_found = 1

    OTHERS = 2.

    IF sy-subrc NE 0.

    • File not found.

    MESSAGE i137.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " get_physical_file

    &----


    *& Form SCREEN

    &----


    • Subroutine for appearance of the selection screen

    ----


    FORM screen .

    IF p_pserv IS INITIAL.

    LOOP AT SCREEN.

    CASE screen-name.

    WHEN 'P_PFILE1'.

    screen-input = 0.

    MODIFY SCREEN.

    WHEN 'P_PFILE2'.

    screen-input = 0.

    MODIFY SCREEN.

    WHEN 'P_ERRFL1'.

    screen-input = 0.

    MODIFY SCREEN.

    WHEN 'P_ERRFL2'.

    screen-input = 0.

    MODIFY SCREEN.

    ENDCASE.

    ENDLOOP.

    ELSE.

    LOOP AT SCREEN.

    CASE screen-name.

    WHEN 'P_AFILE1'.

    screen-input = 0.

    MODIFY SCREEN.

    WHEN 'P_AFILE2'.

    screen-input = 0.

    MODIFY SCREEN.

    WHEN 'P_AERFL1'.

    screen-input = 0.

    MODIFY SCREEN.

    WHEN 'P_AERFL2'.

    screen-input = 0.

    MODIFY SCREEN.

    ENDCASE.

    ENDLOOP.

    ENDIF.

    ENDFORM. " SCREEN

    &----


    *& Form upload_file

    &----


    • Subroutine to upload data from App server or presentation server

    &----


    FORM upload_file .

    *--If the presentation server radio button is chosen.

    IF p_pserv = c_x.

    • Perform which selects the input file from presentation server

    • using Function GUI_UPLOAD

    PERFORM get_presentation_file.

    • IF the application server radio button is chosen.

    ELSEIF p_aserv = c_x.

    • Perform which selects the input file from application server

    • using OPEN DATASET

    PERFORM get_application_file.

    ENDIF.

    ENDFORM. " upload_file

    &----


    *& Form get_presentation_file

    &----


    • Subroutine to get the presentation file name

    ----


    FORM get_presentation_file .

    DATA: lv_file1 TYPE string,

    lv_file2 TYPE string.

    *--CLear the variables

    CLEAR: lv_file1,

    lv_file2.

    MOVE: v_fname1 TO lv_file1,

    v_fname2 TO lv_file2.

    • Call the function to get the purchasing contract file into an

    *internal table.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    filename = lv_file1

    filetype = c_asc

    has_field_separator = c_x

    TABLES

    data_tab = i_temp

    EXCEPTIONS

    file_open_error = 1

    file_read_error = 2

    no_batch = 3

    gui_refuse_filetransfer = 4

    invalid_type = 5

    no_authority = 6

    unknown_error = 7

    bad_data_format = 8

    header_not_allowed = 9

    separator_not_allowed = 10

    header_too_long = 11

    unknown_dp_error = 12

    access_denied = 13

    dp_out_of_memory = 14

    disk_full = 15

    dp_timeout = 16

    OTHERS = 17.

    IF sy-subrc <> 0.

    • File not found.

    MESSAGE e138.

    ENDIF.

    • Upload the data into the flat file and then split

    • the data basing on (H/L/C/S)

    PERFORM split_data1.

    • Call the function to get the long text file into an internal table.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    filename = lv_file2

    filetype = c_asc

    has_field_separator = c_x

    TABLES

    data_tab = i_text

    EXCEPTIONS

    file_open_error = 1

    file_read_error = 2

    no_batch = 3

    gui_refuse_filetransfer = 4

    invalid_type = 5

    no_authority = 6

    unknown_error = 7

    bad_data_format = 8

    header_not_allowed = 9

    separator_not_allowed = 10

    header_too_long = 11

    unknown_dp_error = 12

    access_denied = 13

    dp_out_of_memory = 14

    disk_full = 15

    dp_timeout = 16

    OTHERS = 17.

    IF sy-subrc <> 0.

    • File not found.

    MESSAGE e138.

    ENDIF.

    ENDFORM. " get_presentation_file

    &----


    *& Form get_application_file

    &----


    • Subroutine to get the application file name

    ----


    FORM get_application_file .

    *Local Variables

    DATA : lv_dsn1(1000) TYPE c,

    lv_dsn2(1000) TYPE c.

    • Local Work Area

    DATA: lwa_input1 TYPE t_input1,

    lwa_input2 TYPE t_input1.

    CONCATENATE v_fname1(15) c_path p_afile1 INTO lv_dsn1.

    CONCATENATE v_fname1(15) c_path p_afile2 INTO lv_dsn2.

    • Open Dataset for Purchasing Contracts

    PERFORM open_dataset USING lv_dsn1

    lwa_input1

    i_input1.

    • Open Dataset for Long Texts

    PERFORM open_dataset USING lv_dsn2

    lwa_input2

    i_input2.

    ENDFORM. " get_application_file

    &----


    *& Form split_data

    &----


    • Subroutine to split data from flat file.

    ----


    FORM split_data .

    DATA:

    • Work area for text record

    lwa_text TYPE t_text.

    DATA :

    • Record type variable.

    lv_rec_type TYPE c.

    • First input file which has purchasing contracts details

    IF NOT i_input1[] IS INITIAL.

    LOOP AT i_input1 INTO wa_input1.

    CLEAR lv_rec_type.

    MOVE wa_input1+0(1) TO lv_rec_type.

    • Check for the record type

    CASE lv_rec_type.

    WHEN c_h.

    SPLIT wa_input1-text AT c_tab INTO wa_header-rec_type

    wa_header-lifnr

    wa_header-evart

    wa_header-vedat

    wa_header-ekorg

    wa_header-ekgrp

    wa_header-epstp

    wa_header-knttp

    wa_header-bukrs

    wa_header-kdatb

    wa_header-kdate

    wa_header-ktwrt

    wa_header-waers

    wa_header-wkurs

    wa_header-inco1

    wa_header-inco2

    wa_header-ihran

    wa_header-angnr.

    APPEND wa_header TO i_header.

    CLEAR wa_header.

    WHEN c_i.

    SPLIT wa_input1-text AT c_tab INTO wa_header-rec_type

    wa_header-bmatn

    wa_header-mfrpn

    wa_header-mfrnr

    wa_header-ktmang

    wa_header-txz01

    wa_header-meins

    wa_header-matkl

    wa_header-spinf.

    APPEND wa_header TO i_header.

    CLEAR wa_header.

    WHEN c_c.

    SPLIT wa_input1-text AT c_tab INTO wa_header-rec_type

    wa_header-datab

    wa_header-datbi

    wa_header-kschl

    wa_header-kbetr

    wa_header-kmein.

    APPEND wa_header TO i_header.

    CLEAR wa_header.

    WHEN c_s.

    SPLIT wa_input1-text AT c_tab INTO wa_header-rec_type

    wa_header-ksbtm

    wa_header-kbetr1.

    APPEND wa_header TO i_header.

    CLEAR wa_header.

    ENDCASE. "CASE lv_rec_type.

    ENDLOOP. "LOOP AT i_input1 INTO wa_input1.

    ENDIF. "IF NOT i_input1[] IS INITIAL.

    • The second input file which has long texts

    IF NOT i_input2[] IS INITIAL.

    LOOP AT i_input2 INTO wa_input2.

    CLEAR lv_rec_type.

    MOVE wa_input2+0(1) TO lv_rec_type.

    CASE lv_rec_type.

    WHEN c_h.

    SPLIT wa_input2-text AT c_tab INTO lwa_text-rec_type

    lwa_text-id

    lwa_text-lifnr

    lwa_text-evart

    lwa_text-vedat

    lwa_text-ekorg

    lwa_text-ekgrp

    lwa_text-text.

    APPEND lwa_text TO i_text.

    CLEAR lwa_text-text.

    WHEN c_i.

    SPLIT wa_input2-text AT c_tab INTO lwa_text-rec_type

    lwa_text-id

    lwa_text-lifnr

    lwa_text-evart

    lwa_text-vedat

    lwa_text-ekorg

    lwa_text-ekgrp

    lwa_text-matnr

    lwa_text-text.

    APPEND lwa_text TO i_text.

    CLEAR lwa_text.

    ENDCASE. "CASE lv_rec_type.

    ENDLOOP. "LOOP AT i_input1 INTO wa_input1.

    ENDIF. "IF NOT i_input1[] IS INITIAL

    • Clear the internal tables

    REFRESH : i_input1,

    i_input2.

    ENDFORM. " split_data

    reward if helpful.

    Regards,

    nagaraj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 10:41 AM

    Providing all local n sequential files as f4 help

    REPORT Z50651_FILENAMES_F4 MESSAGE-ID ZMSG_50651.

    ***********SELECTION SCREEN***********************

    PARAMETERS : LOCAL RADIOBUTTON GROUP G1 USER-COMMAND UCOM1,

    APPLN RADIOBUTTON GROUP G1 .

    PARAMETERS : P_HEADER TYPE IBIPPARMS-PATH.

    ***********DATA DECLARATIONS*********************

    DATA : V_FLAG,

    V_HEADER1 TYPE DXFIELDS-LONGPATH,

    V_HEADER TYPE IBIPPARMS-PATH.

    AT SELECTION-SCREEN ON RADIOBUTTON GROUP G1.

    PERFORM CHECK_RADIO.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_HEADER.

    PERFORM GET_F4_HELP.

    **************FORMS*********************************

    &----


    *& Form CHECK_RADIO

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM CHECK_RADIO .

    CASE SY-UCOMM.

    WHEN 'UCOM1'.

    IF LOCAL = 'X'.

    V_FLAG = 'L'.

    ELSE.

    V_FLAG = 'A'.

    ENDIF.

    ENDCASE.

    ENDFORM. " CHECK_RADIO

    &----


    *& Form GET_F4_HELP

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM GET_F4_HELP .

    IF V_FLAG = 'L'.

    CALL FUNCTION 'F4_FILENAME'

    EXPORTING

    PROGRAM_NAME = SYST-CPROG

    DYNPRO_NUMBER = SYST-DYNNR

    FIELD_NAME = 'P_HEADER'

    IMPORTING

    FILE_NAME = V_HEADER.

    P_HEADER = V_HEADER.

    ELSEIF V_FLAG = 'A'.

    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

    EXPORTING

    I_LOCATION_FLAG = 'A'

    I_SERVER = '?'

    • I_PATH =

    FILEMASK = '.'

    FILEOPERATION = 'R'

    IMPORTING

    • O_LOCATION_FLAG =

    • O_SERVER =

    O_PATH = V_HEADER1

    • ABEND_FLAG =

    EXCEPTIONS

    RFC_ERROR = 1

    ERROR_WITH_GUI = 2

    OTHERS = 3

    .

    IF SY-SUBRC <> 0.

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

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

    ENDIF.

    ENDIF.

    ENDFORM. " GET_F4_HELP

    Add comment
    10|10000 characters needed characters exceeded