How to handle error messages in BDC background mode

Hi experts,
  I got one problem in BDC, We are uploading data throgh BDC program,that program is calling Standard Batch Input programs,
Now we got one requirement, i.e., In some special cases we have to send one message as a error message.I handled this in foreground but, how to handle this in background.

Hi,
if session is being used
automatically the log will begenereated in the sm35 transaction
but if call transaction is used
put all the error messages in the applicationserver using
open data set
and after the exectionof the program in the background
you have to run another progam which reads the data stroed inthe application server
that also with open data set only...
thanks & regards,
Venkatesh

Similar Messages

  • How To Handle Error Message In TCD Recording?

    Hi All,
      I tried recording a transaction (my own transaction) by not enterring value in an obligatory field. the error message came. but when i executed the script, it showed an error. but actualy, the error message was expected right? how to handle this situation? i tried with tcd and sapgui recording. both gave almot the same result.
      i am including the script which i have written.
    MESSAGE ( MSG_1 ).
    *TCD ( ZCUST , ZCUST_1 , ECC ).
    SAPGUI ( SAP_1 , ECC ).
    ENDMESSAGE ( E_MSG_1 ).
    v_mno = &tfill.
    v_msg = E_MSG_1[v_mno]-msgtext.
    v_mtp = E_MSG_1[v_mno]-msgtyp.
    If Msg Type is E *** **** It Has To Be E ****
    IF ( v_mtp = 'E' and v_msg = 'Account no AC02 does not exist EXIT = X').
    logtext(0,'Passed').
    ELSE.
    log(v_mtp).
    log(v_msg).
    logtext(1,'Failed').
    ENDIF.
    End Of The Condition For Message Type E ******

    I have recording messages using the TCD command.
    My script (very simple):
    MESSAGE ( MSG_2 ).
    TCD ( ME21 , ME21_1 , R3 ).
    ENDMESSAGE ( E_MSG_2 ).
    In the MESSAGE command interface, I defined rules to allow several kind of messages.
    Execution: 3 mesages found:
          * transform PR into PO
           MESSAGE     MSG_2 [1,009 sec]
             RULES  MSG_2 = XML-DATA-01
            Message  MODE  EXIT  TYPE  ID    NR
            [1]      'A'         'I'   06    456
            [2]      'A'         'W'   'ME'  080
            [3]      'A'         'E'   'ZE'  029
             TCD    ME21                 [0,545 sec N] Target sys R3 -> ZDA010A219
            S06017 Standard PO created under the number 8201075606
               Tgt System Z_A219->R3->ZDA010A219 (ZDA 010 ... HP-UX ORACLE)
               CALL TRANSACTION ME21 ME21_1 XML-DATA-01
               03 MESSAGES FROM ME21 ME21_1 XML-DATA-01
               I  06 456 Release effected with release code 00001
               W  ME  080 Delivery date: next workday is 02.05.2007
               S  06 017 Standard PO created under the number 8201075606
           ENDMESSAGE  E_MSG_2 (&TFILL = 0)
    As you can see, 3 messages are found but the &TFILL variable is still 0.
    I guess (but cannot test yet) I would manage to record those messages using SAPGUI command.
    Is there anything wrong with my script?
    My SAP_BASIS component is in version 620. I'm not using the ultimate version of eCATT (no WEBDYNPRO command, etc.). Could it be an explanation?
    Thank you in advance,
    Olivier

  • How to handle error message during PAI?

    Hi Experts,
    Need help here.
    In my dialog screen, I have a field which is typed 'QUAN'.
    In entering different format , e.g. with non numeric value or a negative value, an error message appear and it does not process the MODULES inside the chain or FIELD MODULE ON REQUEST.
    Does anyone knows how to handle this kind of error. I need to display into a separate screen the errors I encountered coz I'm creating a new RF transaction.
    Points will be rewarded.
    Thanks in advance.

    Hai
    in your case(RF case) it is other way...
    yes you can use
    field x_currency module check_currency.
    in module check_currency.
    you have to display errors in another screen say 200.
    in that there will be 4 fields, all are display only fields.
    X_MESSAGE-MSGV1  of type sy-msgv1
    X_MESSAGE-MSGV2  of type sy-msgv2
    X_MESSAGE-MSGV3 of type sy-msgv3
    X_MESSAGE-MSGV4 of type sy-msgv4
    you populate the messages with these fields and then display it in the screen.
      method check_currency.
    *--do all your checks here....
           if error
             clear x_message.
            x_message-msgv1 = 'Enter Valid Employee Number'(004).
            leave to screen 0200.
          endif.
        endif.
    ENDMODULE.                 " VALIDATE_Currency
    in screen 200 PBO you need to format the message
    using the below logic.
           Method for formatting the message
      method message_format.
        data : lt_text type table of tline,         "text table
               lx_text type tline.                  "work area
        refresh lt_text.
        clear lx_text.
        concatenate x_message-msgv1 x_message-msgv2 into lx_text-tdline
          separated by space.
        append lx_text to lt_text.
        clear lx_text.
        concatenate x_message-msgv3 x_message-msgv4 into lx_text-tdline
          separated by space.
        append lx_text to lt_text.
    *- formatting the message
        call function 'FORMAT_TEXTLINES'
          exporting
            formatwidth = 20
          tables
            lines       = lt_text
          exceptions
            bound_error = 1
            others      = 2.
        clear: x_message.
    *- transfer the message data to screen fields
        loop at lt_text into lx_text.
          if sy-tabix = 1.
            x_message-msgv1 = lx_text-tdline.
          elseif sy-tabix = 2.
            x_message-msgv2 = lx_text-tdline.
          elseif sy-tabix = 3.
            x_message-msgv3 = lx_text-tdline.
          elseif sy-tabix = 4.
            x_message-msgv4 = lx_text-tdline.
          else.
            exit.
          endif.
        endloop.
      endmethod.                    "message_format
    Regards
    Vijay

  • How to handle Error Records in BDC

    Dear All,
         I have 100 records in flat file but 10 records have error record.
         Use on the BDC method, error records should be move to session  and remaining process through  call Transaction .
         Any one help to me.
    With Regards,
    Baskaran

    Hi,
    Do it like this:
    Loop at itab into wa.
    gv_flag = 'N'.
    If gv_flag = 'N'.
    Perform...
    wa_opts-dismode = 'N'. "for background
          wa_opts-updmode ='S'.
          wa_opts-defsize = 'X'.
          wa_opts-nobinpt = 'X'.
    Where  wa_opts  TYPE ctu_params.
    *Call transaction
          CALL TRANSACTION 'PA30' USING gi_bdcdata
                             OPTIONS FROM wa_opts
                             MESSAGES INTO gi_messtab.
    IF sy-subrc EQ 0.
            COMMIT WORK.
          ELSE.
            IF NOT gi_messtab[] IS INITIAL.
              LOOP AT gi_messtab INTO wa_messtab.
                IF wa_messtab-msgtyp EQ 'E' OR
                   wa_messtab-msgtyp EQ 'A' OR
                   wa_messtab-msgtyp EQ 'X' OR
                   wa_messtab-msgid  EQ 'PBAS_SERVICE'.
                  CLEAR gv_msg.
                  CALL FUNCTION 'FORMAT_MESSAGE'
                    EXPORTING
                      id        = wa_messtab-msgid
                      lang      = sy-langu
                      no        = wa_messtab-msgnr
                      v1        = wa_messtab-msgv1
                      v2        = wa_messtab-msgv2
                      v3        = wa_messtab-msgv3
                      v4        = wa_messtab-msgv4
                    IMPORTING
                      msg       = gv_msg
                    EXCEPTIONS
                      not_found = 1
                      OTHERS    = 2.
    *In case of no error message returned by BDC
                  IF sy-subrc = 0.
    Sending errors stating which infotypes are not updated.
                    gv_error_flag = 'Y'.
                   do th required proccesing here.
                  ELSE.
                    gv_error_flag = 'Y'.
                   statements.
                  ENDIF.
                ENDIF.
                CLEAR wa_messtab.
              ENDLOOP.
    endloop.
    Regards,
    Rajesh Kumar
    Edited by: Rajesh Kumar on Sep 17, 2009 7:58 AM

  • How to handle error message

    I recently had to download driver as printer stopped printing - got printer to print but still receiving message:
    "Runtime Error   Program:C:\Program Files (x86)\HP]Digital Imaging]bin\HPQKYGRP/EXE     -This application has requested the Runtime to terminate in an unusual way.  Please contact the application's support team for more information.
    What do I do with this??? I am way over my head.
    Help please.

    Hello Cathyvi. I understand you are experiencing a runtime error. Could you please explain when the error occurs? Could you also provide the following information:
    1. The printer model number. If you require assistance locating this information, please reference this website: http://h10010.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&dlc=en&docname=bpy21016
    2. Your operating system. If you require assistance locating this information, please reference this website: http://windows.microsoft.com/en-CA/windows/which-operating-system
    I look forward to your response.
    Mario
    I worked on behalf of HP.

  • Handle error message

    hi
    How to handle error message for following FM?
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = lv_filename
        filetype                        = 'DBF'
        write_field_separator           = 'X'
    IMPORTING
      filelength                      = lv_file_len
       TABLES
        data_tab                        = it_final
        fieldnames                      = t_header
        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 <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    Error Message:  GUI_DOWNLOAD
    GUI_DOWNLOAD - Access Denied!! Why its throwing error message?
    Control flush error in gui_download
    Error in GUI_DOWNLOAD in background processing
    Error In Gui_download
    Reward points..

  • How to Customize Error message in JXL

    Hi All,
    I want to customize error message in JXL. I.e. When we apply number validation to a cell and if you enter invalid data MS-Excel shows error message saying that "The value you entered is not valid". But I want to customize this message to "Data should be a decimal number". Can anyone help me how to acheive it. Thanks in Advance.
    Thanks
    Venkat.

    Thx alot...!! for all your valuable replies.
    And, I found a way to achieve my requirement in a declarative way.
    I just created an entity validator on EmployeeEO.
    - Rule_Type: Key Exists
    - Rule Definition:
    - Validation Target Type: Entity Object
    - Association Name : <Select Assiociation created > "EmpDeptFK"
    - Failure Handling:
    - Error Message: "Invalid Deparment ID {0} Entered. Please enter a valid Department ID."
    - Message Token for "0": Department ID
    And It fulfilled my requirement.

  • HOW TO HANDLE MULTIPLE VALUES IN BDC FOR A PARTICULAR FIELD.

    I THINK IT IS HANDLING OF TABLE CONTROLS IN BDC
    PLEASE LET KNOW WHETHER THESE TWO ARE SAME CONCEPT OR NOT
    HOW TO HANDLE TABLE CONTROLS IN BDC
    Moderator message - Please do not use all caps. Please do not ask interview questions -  post locked
    Edited by: Rob Burbank on Jun 26, 2009 10:02 AM

    Hi,
    To handle table control in BDC you will have to enter at least one record in the table control and there after use the index number to increment to the next line item.
    Say you run a recording for a transaction which has a table control (ME21), here after you have completed the recording, you'll see the code which will have sometjing like <fieldname>(01) and the entered value. that valeu has been entered as the first line item (01 being the index).
    You will have to replace the hard coded line item index with a variable and inside a loop increment the item index. Once you reach the maximum allowed line items on your screen juct press the pagedown button (or insert new row) and reset the index to 1.
    Following is a code snippet I used while uploading data for ME31K (vendor contract). It is not the complete code but does show how your code needs to be changed with using index for line items.
    Here we assumne that the maximun number of lines displayed at a time on the screen is 14.
    << Unformatable code removed >>
    Hope this helps.
    Regards,
    Sachin
    Edited by: Rob Burbank on Jun 26, 2009 10:03 AM

  • Changing the Error message in the background

    Hi Experts,
    Is there any way to catch the Error message in the background apart from changing the message type.
    Because the error message is coming from a standard function and I want my program should handle the error message. Whether this can be possible if possible can anyone please let me know the process.
    Thanks in advance.
    Regards,
    Srinivas
    Edited by: Srinivas Hari on Jun 23, 2009 10:08 AM

    Hi Srini,
    The question is not very clear still I am trying to answer this.
    If my understanding is correct you are trying to run a standard function module in background task in your custom program and that FM is giving some error messages but not raising any exceptions and you are trying to catch those exceptions in your program. If that is be the case then yes you can definitely catch that error messages.
    Step 1 : Call function 'XXXX' IN BACKGROUND TASK
    Step 2: Call function 'ID_OF_BACKGROUNDTASK'
    Step 3: COMMIT WORK and WAIT.
    Step 4: Call function 'STATUS_OF_BACKGROUNDTASK' ---> passing the id number which you will receive in Stpe 2.
    Basically the step 4 would return you the error messages which would be visible in Transaction SM58.
    Regs,
    Somnath

  • How to handle Table control in BDC? Difference between BDC & LSMW?

    Hi
    How to handle Table control in BDC? Difference between BDC & LSMW?
    Regards,
    Raghu

    Hi ,
    the diff b/w normal BDC and with table control is that with table control u can enter as many lineitems as u want..so during recording if u r entering 3 line items..then the program will show (1), (2) and (3) with that.
    chane that fixed no to variable.
    check that sample code.
    in this for new customer...any no of items can be entered.
    LOOP AT t_cusdata.
        REFRESH t_bdcdata.
        ON CHANGE OF t_cusdata-kunnr.
    initial screen.
          PERFORM bdc_dynpro      USING 'SAPMV10A' '0100'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'MV10A-VTWEG'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
          PERFORM bdc_field       USING 'MV10A-KUNNR'
                                  t_cusdata-kunnr.
          PERFORM bdc_field      USING 'MV10A-VKORG'
                                  t_cusdata-vkorg.     "'HCL'.
          PERFORM bdc_field       USING 'MV10A-VTWEG'
                                  t_cusdata-vtweg.     "'HL'.
          DATA: fnam(20) TYPE c,
                fnam1(20) TYPE c,
                idx(2) TYPE c.
          MOVE 1 TO idx.
          LOOP AT t_matdata WHERE kunnr = t_cusdata-kunnr.
            PERFORM bdc_dynpro      USING 'SAPMV10A' '0200'.
            CONCATENATE 'MV10A-KDMAT(' idx ')' INTO fnam.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          fnam.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '/00'.
            CONCATENATE 'MV10A-MATNR(' idx ')' INTO fnam1.
            PERFORM bdc_field       USING fnam1
                                          t_matdata-matnr.      "'FIN50'.
            PERFORM bdc_field       USING fnam
                                          t_matdata-kdmat.  "'ABCD'.
            idx = idx + 1.
          ENDLOOP.
          PERFORM bdc_dynpro      USING 'SAPMV10A' '0200'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'MV10A-MATNR(01)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=SICH'.
          CALL TRANSACTION 'VD51' USING t_bdcdata MODE 'A' .
                                        UPDATE 'S' MESSAGES INTO t_err_mes.
    Regards,
    Sonika

  • How to send error message to forms from Database Trigger

    Hi, Please help me to send error message to forms from Database Trigger?
    RgDs,
    Madesh.R.M

    You are correct, the On-Error trigger is a Forms trigger. However, if your Form is going to display the error generated by the database stored procedure or trigger - you might not see the database error in your Form unless you check the DBMS_ERROR_CODE in the On-Error trigger and manually display the Error Code and associated Text. I've see this happen with a co-worker. The Form she was working on was based on a table with an Before-Insert trigger. Because she was not explicitely handling the error from the Before-Insert trigger in the Forms On-Error trigger, her Form appeared to halt for no reason at all. Once she added code to the On-Error trigger in the Form to handle the DBMS_ERROR_CODE, she discovered the trigger was producing an error and was able to show the error to the user in the On-Error trigger.
    I understand the desire to keep as much as possbile in the database, but with that comes some extra coding in your Forms to handle this. This extra coding could easily be placed in a Forms Library, attached to a Form and called in the On-Error trigger. Your code could look like this:
    DECLARE
       /*This example assumes you have an Alert defined
          in your Form called: 'ERROR' */  
       al_id    ALERT;
       al_text  VARCHAR2(200);  /* Max text of a Forms Alert message*/
       al_btn   NUMBER;
    BEGIN
    IF DBMS_ERROR_CODE != 0 THEN
       /* Error code is ORA-00000 Normal Successful completion
           So only handle non-zero errors  */
       al_text := DBMS_ERROR_CODE||':'||DBMS_ERROR_TEXT;
       al_id := Find_Alert('ERROR');
       set_alert_property(al_id, alert_message_text, al_text);
       al_btn := show_alert(al_id);
    END IF;
    END;Your original question was "How to send error message to forms from Database Trigger?" The answer is you don't because Forms already gets the database error code and database message through the Forms DBMS_ERROR_CODE and DBMS_ERROR_TEXT functions. Look these up in the Forms help and it should clear things up for you.
    Craig...
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:50 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM

  • Hi abapers how to handle table control in bdc

    hi experts please guide me
    how to handle table control in bdc? could u please explain me briefly  
    thanks and regards

    sayeed,
    Go thru this code it may help you. check bold code for the table control..
    report zsunil_bdc
    no standard page heading line-size 255.
    INTERNAL TABLES *
    DATA: BEGIN OF IT_KNA1 OCCURS 0,
    CUSTOMER LIKE RF02D-KUNNR,
    COMPANY_CODE LIKE RF02D-BUKRS,
    ACCOUNT_GROUP LIKE RF02D-KTOKD,
    TITLE LIKE KNA1-ANRED,
    NAME LIKE KNA1-NAME1,
    SEARCH_TERM LIKE KNA1-SORTL,
    STREET LIKE KNA1-STRAS,
    CITY LIKE KNA1-ORT01,
    POSTAL_CODE LIKE KNA1-PSTLZ,
    COUNTRY LIKE KNA1-LAND1,
    LANGUAGE_KEY LIKE KNA1-SPRAS,
    CNTRY LIKE KNBK-BANKS,
    BANK_KEY LIKE KNBK-BANKL,
    BANK_ACCOUNT LIKE KNBK-BANKN,
    REC_ACCOUNT LIKE KNB1-AKONT,
    END OF IT_KNA1.
    DATA: IT_BDCDATA TYPE BDCDATA OCCURS 0 WITH HEADER LINE.
    DATA: IT_MESSAGES TYPE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    SELECTION SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER P_FILE TYPE RLGRAP-FILENAME DEFAULT 'C:\CUSTOMER.TXT'
    OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION SCREEN *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    PERFORM HELP_FILE USING P_FILE.
    START OF SELECTION *
    START-OF-SELECTION.
    *UPLOADING THE FILE FROM WORKSTATION
    PERFORM UPLOAD_FILE USING P_FILE.
    *POPULATING DATA.
    PERFORM POPULATE_FILE.
    *& Form HELP_FILE
    text
    -->P_P_FILE text
    form HELP_FILE using p_p_file.
    DATA: L_FILE TYPE IBIPPARMS-PATH.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    FIELD_NAME = ' '
    IMPORTING
    FILE_NAME = L_FILE.
    P_P_FILE = L_FILE.
    endform. " HELP_FILE
    *& Form UPLOAD_FILE
    text
    -->P_P_FILE text
    form UPLOAD_FILE using p_p_file.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = 'P_P_FILE'
    FILETYPE = 'DAT'
    ITEM = ' '
    FILEMASK_MASK = ' '
    FILEMASK_TEXT = ' '
    FILETYPE_NO_CHANGE = ' '
    FILEMASK_ALL = ' '
    FILETYPE_NO_SHOW = ' '
    LINE_EXIT = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    SILENT = 'S'
    IMPORTING
    FILESIZE =
    CANCEL =
    ACT_FILENAME =
    ACT_FILETYPE =
    TABLES
    data_tab = IT_KNA1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform. " UPLOAD_FILE
    *& Form POPULATE_FILE
    text
    --> p1 text
    <-- p2 text
    form POPULATE_FILE .
    DATA: L_STRING TYPE STRING,
    L_COUNTER(2) TYPE N,
    V_INDEX TYPE SY-TABIX.
    LOOP AT IT_KNA1.
    V_INDEX = SY-TABIX.
    AT NEW CUSTOMER.
    READ TABLE IT_KNA1 INDEX V_INDEX.
    IF SY-SUBRC = 0.
    perform bdc_dynpro using 'SAPMF02D' '0105'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02D-KTOKD'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02D-KUNNR'
    IT_KNA1-CUSTOMER.
    perform bdc_field using 'RF02D-BUKRS'
    IT_KNA1-COMPANY_CODE.
    perform bdc_field using 'RF02D-KTOKD'
    IT_KNA1-ACCOUNT_GROUP.
    *PERFORM BDC_FIELD USING 'RF02D-D0130'
    'X'.
    perform bdc_dynpro using 'SAPMF02D' '0110'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-SPRAS'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'KNA1-ANRED'
    IT_KNA1-TITLE.
    perform bdc_field using 'KNA1-NAME1'
    IT_KNA1-NAME.
    perform bdc_field using 'KNA1-SORTL'
    IT_KNA1-SEARCH_TERM.
    perform bdc_field using 'KNA1-STRAS'
    IT_KNA1-STREET.
    perform bdc_field using 'KNA1-ORT01'
    IT_KNA1-CITY.
    perform bdc_field using 'KNA1-PSTLZ'
    IT_KNA1-POSTAL_CODE.
    perform bdc_field using 'KNA1-LAND1'
    IT_KNA1-COUNTRY.
    perform bdc_field using 'KNA1-SPRAS'
    IT_KNA1-LANGUAGE_KEY.
    perform bdc_dynpro using 'SAPMF02D' '0120'.
    perform bdc_field using 'BDC_CURSOR'
    'KNA1-LIFNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPMF02D' '0130'.
    PERFORM BDC_FIELD USING 'RF02D-D0130'
    'X'.
    perform bdc_field using 'BDC_CURSOR'
    'KNBK-BANKN(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPMF02D' '0210'.
    perform bdc_field using 'BDC_CURSOR'
    'KNB1-AKONT'.
    perform bdc_field using 'BDC_OKCODE'
    '=UPDA'.
    perform bdc_field using 'KNB1-AKONT'
    IT_KNA1-REC_ACCOUNT.
    perform bdc_dynpro using 'SAPLRSFH' '0100'.
    perform bdc_field using 'BDC_OKCODE'
    '/EBACK'.
    perform bdc_field using 'BDC_CURSOR'
    'RSIODYNP4-LOW(01)'.
    ENDIF.
    ENDAT.
    L_COUNTER = L_COUNTER + 1.
    CLEAR L_STRING.
    CONCATENATE 'KNBK-BANKS(' L_COUNTER ')' INTO L_STRING.
    PERFORM BDC_FIELD USING L_STRING
    IT_KNA1-CNTRY.
    CLEAR L_STRING.
    CONCATENATE 'KNBK-BANKL(' L_COUNTER ')' INTO L_STRING.
    PERFORM BDC_FIELD USING L_STRING
    IT_KNA1-BANK_KEY.
    CLEAR L_STRING.
    CONCATENATE 'KNBK-BANKN(' L_COUNTER ')' INTO L_STRING.
    PERFORM BDC_FIELD USING L_STRING
    IT_KNA1-BANK_ACCOUNT.
    AT END OF CUSTOMER.
    READ TABLE IT_KNA1 INDEX V_INDEX.
    IF SY-SUBRC = 0.
    CALL TRANSACTION 'FD01' USING IT_BDCDATA MODE 'A' UPDATE 'S' MESSAGES
    INTO IT_MESSAGES.
    IF SY-SUBRC <> 0.
    PERFORM EMPLOYEEID_ERROR.
    *ELSE.
    ENDIF.
    WRITE: SY-SUBRC.
    perform message_format_write.
    *ENDIF.
    *WRITE: SY-SUBRC.
    CLEAR IT_BDCDATA.
    REFRESH IT_BDCDATA.
    ENDIF.
    ENDAT.
    ENDLOOP.
    endform. " POPULATE_FILE
    *& Form bdc_dynpro
    text
    -->P_0224 text
    -->P_0225 text
    form bdc_dynpro using value(p_0224)
    value(p_0225).
    IT_BDCDATA-PROGRAM = P_0224.
    IT_BDCDATA-DYNPRO = P_0225.
    IT_BDCDATA-DYNBEGIN = 'X'.
    APPEND IT_BDCDATA.
    CLEAR IT_BDCDATA.
    endform. " bdc_dynpro
    *& Form bdc_field
    text
    -->P_0229 text
    -->P_0230 text
    form bdc_field using value(p_0229)
    value(p_0230).
    IT_BDCDATA-FNAM = P_0229.
    IT_BDCDATA-FVAL = P_0230.
    APPEND IT_BDCDATA.
    CLEAR IT_BDCDATA.
    endform. " bdc_field
    *& Form EMPLOYEEID_ERROR
    text
    --> p1 text
    <-- p2 text
    form EMPLOYEEID_ERROR .
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    DEST = FILLER8
    GROUP = 'Z50583_REC1'
    HOLDDATE = FILLER8
    KEEP = 'X'
    USER = SY-UNAME
    RECORD = FILLER1
    PROG = SY-CPROG
    IMPORTING
    QID =
    EXCEPTIONS
    CLIENT_INVALID = 1
    DESTINATION_INVALID = 2
    GROUP_INVALID = 3
    GROUP_IS_LOCKED = 4
    HOLDDATE_INVALID = 5
    INTERNAL_ERROR = 6
    QUEUE_ERROR = 7
    RUNNING = 8
    SYSTEM_LOCK_ERROR = 9
    USER_INVALID = 10
    OTHERS = 11.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = 'FD01'
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    SIMUBATCH = ' '
    CTUPARAMS = ' '
    TABLES
    dynprotab = IT_BDCDATA
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 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.
    endform. " EMPLOYEEID_ERROR
    *& Form message_format_write
    text
    --> p1 text
    <-- p2 text
    form message_format_write .
    DATA: L_MSG(200).
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = SY-MSGID
    LANG = SY-LANGU
    NO = SY-MSGNO
    V1 = SY-MSGV1
    V2 = SY-MSGV2
    V3 = SY-MSGV3
    V4 = SY-MSGV4
    IMPORTING
    MSG = L_MSG
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2.
    WRITE: / L_MSG.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform. " message_format_write
    ~~Guduri

  • Passing BAPI  Error Messages to BDC  Session.

    Hi,
    Can any one drive the idea how to convert rather passing BAPI error messages into BDC session.
    regards.

    Naveen,
    I am sure you already have the logic of "If the call transaction is errored out you create a BDC session for the same data".
    Now, when your BAPI fails, irrespective of the error, you need to build the BDCDATA table and pass the data to the session. So, I don't you really need to know the errors and pass them to the BDC Session.
    Check the RETURN table of the BAPI, if it has got E / A / X error types then you can build the BDCDATA table and create the session.
    Regards.
    Ravi
    Note : Please mark the helpful answers and close the thread if the issue is resolved.

  • How to prevent error message for material description in MDG material detail screen, when user click on check action

    Dear Experts,
    I have a requirement for making material description as non mandetory in change request view of mdg material screen.
    I have done that using field usage in get data method of feeder classes, but still message is displaying.
    This message 'Material description is mandatory is displaying with check action only, but not with save or submit after i anhance field property as not mandetory.
    How to prevent error message for material description in MDG material detail screen, when user click on check action.
    Thanks
    Sukumar

    Hello Sukumar
    In IMG activity "Configure Properties of Change Request Step", you can completely deactivate the reuse area checks (but will then loose all other checks of the backend business logic as well).
    You can also set the error severity of the checks from Error to Warning (per CR type, not per check).
    Or you provide a default value for the material description, e.g. by implementing the BAdI USMD_RULE_SERVICE.
    Regards, Ingo Bruß

  • How to print error messages in browser?

    When I visit a jsp file in browser, there's some errors in the jsp file, so the browser returns
    The page cannot be displayed
    There is a problem with the page you are trying to reach and it cannot be displayed.
    I want the detail error messages, so I can debug my problem. How to print error message in browser or find the message in some log file?

    Hi Kanaraja,
    Thanks for your answer. I need to get certain information from the list. So, I use LIST_To_ASCII FM. However, may I know the ascii_tab should be type to what? And after this FM, do I have to use another FM to display the ascii list?
    data ABAPLIST type ABAPLIST OCCURS 0.
    SUBMIT  RPCALCU0 VIA SELECTION-SCREEN
    with PNPXABKR = 'US'
    with PNPTIMRA = 'X'
    with PNPPABRP = '10'
    with PNPPABRJ = '2003'
    with PNPPERNR-LOW = '100750'
    with PNPPERNR-LOW = '109202'
    with PNPPERNR-LOW = '100255'
    with PNPABKRS-LOW = 'US'
    with SCHEMA = 'ZUSP'
    with RADI_EDT ='X'
    with EDT_VARI = 'CUS&SAP_US'
    with TST_ON = 'X'
    EXPORTING LIST TO MEMORY and RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject       = ABAPLIST
    EXCEPTIONS
       NOT_FOUND        = 1
       OTHERS           = 2.
    CALL FUNCTION 'LIST_TO_ASCI'
      EXPORTING
        list_index         = -1
      TABLES
        listasci           = asci_tab
        listobject         = ABAPLIST
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        OTHERS             = 3.
    IF sy-subrc NE '0'.
      WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
    ENDIF.

Maybe you are looking for

  • How do i add an email address to scan to email desk jet 3050a

    when i scan a doc to email i get a message saying no email is set . how do i set  my email address to send a scan

  • Building a method with more than one result data

    Hi, everyone: I'm a little shy to ask this question, however, it's been hanging in my mind for so long, so I think I'd rather make a confession on it. You may laugh at me if you want, I'm ready for that, but I more look forward to that someone can re

  • Visa in kuwait not accepted for itunes

    I have used my Visa Credit card to purchase or install any apps but it only says, ur payment method is not valid in this store

  • External HD blues

    Ok, so my time machine external HD is a lacie 500GB connected by USB and with it's own plug into the wall power supply(plugged into a power strip, not directly into the wall, of course). Last night when i went to sleep I shut down my McBP and it the

  • No Sound on iPhoto or Quick Time

    I have moved to OS Yosemite and the following issue has occurred. My video clips on iPhoto run fine , but there is no sound with the video or ant volume slider on the video. I have used going back to Finder and playing the video back on Quick time, b