Skip to Content
avatar image
Former Member

Regarding GUI_UPLOAD/GUI_DOWNLOAD

Hi Experts,

I have created a program with gui_upload and download function. its working. But in this program I have to create a log file where I have to maintain the information like how much data is uploaded and downloaded and if some records are not uploaded then why and which are these records. In short I have to create a log file with number of lines inserted , failed, reason for fail etc.

Can anybody help me that how I can do this?

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 04, 2008 at 07:19 AM

    hii

    i think for how much records are uploaded or downloaded..you can use following statement for internal table which you are using for getting data and passing in FM.

    it will give you total number of records

    and for which records are uploaded or downloaded,you can print internal table's values.it will be same.

    DESCRIBE TABLE i_output LINES w_line.

    regards

    twinkal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 07:21 AM

    I assume that you are using BDC for data upload.

    use the FM FORMAT_MESSAGE to know the status of your uploaded record with reason.

    you can find out record is uploaded or failed with reasong for failure from this FM.

    CALL TRANSACTION 'XD01' USING BDCDATA MESSAGES INTO IBDCERR.

    LOOP AT IBDCERR.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    ID = IBDCERR-MSGID

    LANG = 'EN'

    NO = IBDCERR-MSGNR

    V1 = IBDCERR-MSGV1

    V2 = IBDCERR-MSGV2

    V3 = IBDCERR-MSGV3

    V4 = IBDCERR-MSGV4

    IMPORTING

    MSG = NMSG

    EXCEPTIONS

    NOT_FOUND = 1

    OTHERS = 2.

    ENDLOOP.

    Thanks

    Ganesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 07:28 AM

    Hi,

    Please refer to below code

    CALL TRANSACTION lv_trans USING gi_bdcdata MODE lv_mode MESSAGES INTO gi_messtab.

    LOOP AT gi_messtab INTO wa_messtab

    WHERE msgtyp = 'E' OR

    msgtyp = 'A' OR

    msgtyp = 'X'.

    lv_msgv1 = wa_messtab-msgv1.

    lv_msgv2 = wa_messtab-msgv2.

    lv_msgv3 = wa_messtab-msgv3.

    lv_msgv4 = wa_messtab-msgv4.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    id = wa_messtab-msgid

    lang = 'EN'

    no = wa_messtab-msgnr

    v1 = lv_msgv1

    v2 = lv_msgv2

    v3 = lv_msgv3

    v4 = lv_msgv4

    IMPORTING

    msg = lv_msgtext

    EXCEPTIONS

    not_found = 1

    OTHERS = 2.

    IF sy-subrc = 0.

    WRITE: /'Error in record ',

    gv_bukrs, '/', wa_datatab-anln1, '/', wa_datatab-anln2, '-', lv_msgtext.

    ENDIF.

    ENDLOOP.

    IF sy-subrc <> 0.

    WRITE: /'Record for',

    gv_bukrs, '/', wa_datatab-anln1, '/', wa_datatab-anln2,

    'posted successfully.'.

    ENDIF.

    I hope it will help.

    Regards

    Natasha Garg

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi,

      I know the way in BDC.

      In report, you can't know the reason for each record failure but file failure because you are uploading the data at one go.

      But you can know the records inserted by using the statement:

      Describe table <table_name> lines lv_line.

      Regards

      Natasha Garg