Skip to Content

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

fm

Hi,

I am creating new fm and i am uploading a file. i use the gui upload fm in the folling way. when i am excuting its going start dump.

plz let me know what i want to do for this....should i want to declare the file name in string and i want pass it r else....plz can onr help me to do slove it....

FUNCTION CLIENT_LOAD .

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(I_PRODUCT) TYPE ZPRODUCT

*" REFERENCE(FILENAME) LIKE RLGRAP-FILENAME DEFAULT SPACE

*" REFERENCE(FILETYPE) LIKE RLGRAP-FILETYPE DEFAULT 'ASC'

*" EXPORTING

*" REFERENCE(RETURN_CODE) TYPE SY-SUBRC

*"----


CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = filename

FILETYPE = 'ASC'

TABLES

DATA_TAB = t_data.

IF SY-SUBRC <> 0.

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

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

ENDIF.

Thanks

Ankitha....

Former Member
replied

Hi Ankitha..

GUI_UPLOAD expects the Filename to be of Type STRING.

So.. Do this way....

FUNCTION CLIENT_LOAD .

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(I_PRODUCT) TYPE ZPRODUCT

*" REFERENCE(FILENAME) LIKE RLGRAP-FILENAME DEFAULT SPACE

*" REFERENCE(FILETYPE) LIKE RLGRAP-FILETYPE DEFAULT 'ASC'

*" EXPORTING

*" REFERENCE(RETURN_CODE) TYPE SY-SUBRC

*"----


<b>DATA: L_FILE TYPE STRING.

MOVE FILENAME TO L_FILE.

</b>

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

<b>FILENAME = L_FILE</b>

FILETYPE = 'ASC'

TABLES

DATA_TAB = t_data.

IF SY-SUBRC <> 0.

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

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

ENDIF.

<b>reward if Helpful.</b>

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