Call Transction - BDC

Hi,
Can anyone tell me where should i write code(in following BDC program) for handling error messages in Call transction method using bdcmsgcoll?
BDC Code:
report ZBDC_EMPN
no standard page heading line-size 255.
include bdcrecx1.
TABLES: ZTRGEMP, ZTRGDEPT, ZTRGTXN.
parameters: dataset(132) lower case.
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
If it is nessesary to change the data section use the rules:
1.) Each definition of a field exists of two lines
2.) The first line shows exactly the comment
'* data element: ' followed with the data element
which describes the field.
If you don't have a data element use the
comment without a data element name
3.) The second line shows the fieldname of the
structure, the fieldname must consist of
a fieldname and optional the character '_' and
three numbers and the field length in brackets
4.) Each field must be type C.
Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record,
data element:
IEMP_001(006),
data element:
INAME_002(010),
data element:
ISAL_003(010),
data element:
IDPT_004(020),
end of record.
End generated data section ***
DATA : BEGIN OF ITAB OCCURS 0,
EMPNO LIKE ZTRGEMP-EMPNO,
EMPNAME LIKE ZTRGEMP-EMPNAME,
EMPDPT LIKE ZTRGDEPT-EMPDPT,
SALARY LIKE ZTRGTXN-SALARY,
END OF ITAB.
start-of-selection.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'C:\EMP.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = ITAB.
perform open_group.
LOOP AT ITAB.
perform bdc_dynpro using 'ZASS_6' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=CRT'.
perform bdc_field using 'BDC_CURSOR'
'IEMP'.
perform bdc_field using 'IEMP'
ITAB-EMPNO.
perform bdc_dynpro using 'ZASS_6' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=CRT'.
perform bdc_field using 'BDC_CURSOR'
'IDPT'.
perform bdc_field using 'INAME'
ITAB-EMPNAME.
perform bdc_field using 'ISAL'
ITAB-SALARY.
perform bdc_field using 'IDPT'
ITAB-EMPDPT.
perform bdc_dynpro using 'ZASS_6' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=C'.
perform bdc_field using 'BDC_CURSOR'
'INAME'.
perform bdc_transaction using 'ZEMPN'.
ENDLOOP.
perform close_group.
Mahesh

hi mahesh,
after call transaction stmt...
for example give as below...
CALL TRANSACTION 'FK01' USING IT_BDCDATA MODE 'A'
                        UPDATE 'S'
                        MESSAGES INTO IT_MESSAGES.
WRITe:/ SY-SUBRC.
PERFORM FORMAT_MESSAGES.
CLEAR IT_BDCDATA.
REFRESH IT_BDCDATA.
ENDLOOP.
form FORMAT_MESSAGES .
DATA: L_MSG(100).
LOOP AT IT_MESSAGES.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
   ID              = IT_MESSAGES-MSGID
   LANG            = SY-LANGU
   NO              = IT_MESSAGES-MSGNR
   V1              = IT_MESSAGES-MSGV1
   V2              = IT_MESSAGES-MSGV2
   V3              = IT_MESSAGES-MSGV3
   V4              = IT_MESSAGES-MSGV4
IMPORTING
   MSG             = L_MSG
EXCEPTIONS
   NOT_FOUND       = 1
   OTHERS          = 2
write:/ l_msg.
  endloop.
endform.                    " FORMAT_MESSAGES
hope this helps,
do reward if it helps,
priya.

Similar Messages

  • Is it possible to do call transction in utility function  ?

    i try to do call transction for "me33" ,
    the problem is that whan i going back to my transction
    (from  me33)i get order screen .
    is it possible to inforce the transction go back to
    my program  ?
    some utility function or bapi  ?
    thanks.

    Hi Dakota,
    Please try this.
    IF E_COLUMN = 'KONNR'.
    READ TABLE GT_OUTTAB INDEX E_ROW-INDEX INTO GT_OUTTAB.
    SET PARAMETER ID 'VRT' FIELD GT_OUTTAB-KONNR.
    CALL FUNCTION 'C14Z_TRANSACTION_CALL'
      EXPORTING
        I_TCODE                             = 'ME33'
        I_FLG_SKIP_FIRST_SCREEN             = 'X'
      EXCEPTIONS
        ILLEGAL_INPUT                       = 1
        INTERNAL_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.
    Regards,
    Ferry Lianto

  • Issue with ALV sceen called using BDC in new task and in background mode

    Hi Gurus,
    Need your expert advice. I am trying to call one transaction (IS AUTO - VELO) which has ALVs on screen. VELO is being called through BDC in NEW TASK in background. So, the new session is a Dialog session and SY-BATCH is initial here.
    In two different scenarios, I am getting error at two different places:
    a) As I can't call ALV directly, I am using docking container. This is giving issue during 'CREATE OBJECT' -> CONSTRUCTOR for cl_gui_alv_grid ->   if offline( ) is initial. (AS SY-BATCH is initial) -> call method me->set_registered_events_internal exporting events = lt_events. -> call method get_registered_events importing events = lt_events. -> IF H_CONTROL IS INITIAL.     RAISE CNTL_ERROR.   ENDIF.
    b) Call to OLE_FLUSH_CALL is happening, which is resulting into dump.
    I tried to search SDN and google, but couldn't find the solution. Thanks for your help :).
    Regards,
    Alok

    I'm not sure what is eating up your system resources, but .wmv files
    are considered to be a delivery format, and are not ideal for editing.
    I have never tried to edit screen capture video from any source, but you might consider
    upgrading to Expression Encoder 4 Pro (with codecs)... at least it includes H.264.
    Expression Encoder 4 Pro

  • Can we call a BDC from REPORT program.

    hi
    can anybody tell me that
    can we call a BDC from REPORT program.
    thanks&regards

    Yes, It can be called.
    Infact you can generate a program from SHDB recording and in the program generated you can put necessary report logic and call the BDC/CALL TRANSACTION as required.
    <b>Please check here for a sample program,</b>
    http://www.sapdevelopment.co.uk/bdc/bdc_ctcode.htm
    Regards
    Kathirvel

  • Can we call a bdc from a report program?

    hi
    Can we call a bdc from a report program?
    Thanks
    Rama

    Hello,
    Yes..
    Check this example:
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                      RS_SELFIELD TYPE SLIS_SELFIELD.
      DATA : L_EBELN TYPE EKPO-EBELN,
             L_EBELP TYPE EKPO-EBELP.
      DATA : L_DATE1 TYPE SY-DATUM,
             L_DATE2 TYPE SY-DATUM,
             L_YEAR(4),
             L_MONTH(2),
             L_DATE(2).
      DATA: L_AMOUNT1 LIKE RK40C-WTGBTR.
      DATA: L_POSID_OLD TYPE PS_POSID.
      DATA: L_POSID_NEW TYPE PS_POSID.
      DATA: LS_COBK  LIKE COBK.
      DATA: LT_ITEMS    LIKE RK40C OCCURS 0 WITH HEADER LINE,
            LT_COEP     LIKE COEP  OCCURS 0 WITH HEADER LINE,
            LT_COEPL    LIKE COEPL OCCURS 0 WITH HEADER LINE,
            LT_COEPR    LIKE COEPR OCCURS 0 WITH HEADER LINE,
            LT_MESG     LIKE MESG  OCCURS 0 WITH HEADER LINE.
      DATA: LV_NUM TYPE POSNR_ACC VALUE '1'.
      DATA: CD_SEND_REC_REL LIKE COHEADER-SEND_REC_REL,
            LD_STATUS LIKE RK23F-STATUS.
      DATA: L_DYNNR LIKE FELD-DYNNR.
      CLEAR : L_DATE,L_DATE1,L_DATE2,L_YEAR,L_MONTH.
      L_DATE1 = SY-DATUM.
      L_YEAR = L_DATE1(4).
      L_MONTH = L_DATE1+4(2).
      L_DATE = L_DATE1+6(2).
      CONCATENATE L_DATE L_MONTH L_YEAR INTO L_DATE2 .
      CASE R_UCOMM.
        WHEN '&IC1'.   "doubleclick
          CHECK RS_SELFIELD-FIELDNAME = 'EBELN'.
          READ TABLE G_T_FINAL INDEX RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            READ TABLE G_T_TEMP WITH KEY LOGNUM = G_T_FINAL-LOGNUM.
            IF SY-SUBRC = 0.
              MESSAGE I899(KB) WITH TEXT-004.
            ELSE.
              CLEAR : L_EBELN,L_EBELP,LS_COBK,LT_ITEMS,G_T_BDC,G_T_MESSAGE,
                      CD_SEND_REC_REL,LD_STATUS.
              REFRESH: LT_ITEMS,G_T_BDC,G_T_MESSAGE.
              SET PARAMETER ID 'BES' FIELD G_T_FINAL-EBELN.
              GET PARAMETER ID 'BES' FIELD L_EBELN.
              SET PARAMETER ID 'BSP' FIELD G_T_FINAL-EBELP.
              GET PARAMETER ID 'BSP' FIELD L_EBELP.
              SORT G_T_FINAL BY EBELN EBELP.
              READ TABLE G_T_FINAL WITH KEY EBELN = L_EBELN
                                            EBELP = L_EBELP
                                            BINARY SEARCH.
              IF SY-SUBRC = 0.
                LS_COBK-KOKRS = G_T_FINAL-KOKRS.
                LS_COBK-GJAHR = SY-DATUM+0(4).
                LS_COBK-VRGNG = 'RKU1'.
                LS_COBK-PERAB = SY-DATUM+4(2).
                LS_COBK-PERBI = SY-DATUM+4(2).
                LS_COBK-BLDAT = SY-DATUM.
                LS_COBK-BUDAT = SY-DATUM.
                LS_COBK-CPUDT = SY-DATUM.
                LS_COBK-USNAM = SY-UNAME.
                LS_COBK-WSDAT = SY-DATUM.
                LS_COBK-KURST = 'M'.
                LS_COBK-VARNR = '05SAP'.
                LS_COBK-KWAER = G_T_FINAL-WAERS.
                LS_COBK-CPUTM = SY-UZEIT.
                CLEAR : L_POSID_OLD,L_POSID_NEW.
                CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
                     EXPORTING
                          INPUT  = G_T_FINAL-POSID_NEW
                     IMPORTING
                          OUTPUT = L_POSID_NEW.
                CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
                     EXPORTING
                          INPUT  = G_T_FINAL-POSID_OLD
                     IMPORTING
                          OUTPUT = L_POSID_OLD.
                L_AMOUNT1 = G_T_FINAL-AMOUNT.
                LT_ITEMS-ZLENR = LV_NUM.
                LT_ITEMS-EPSPNR = L_POSID_NEW.
                LT_ITEMS-SPSPNR = L_POSID_OLD.
                LT_ITEMS-KSTAR  = G_T_FINAL-KSTAR.
                LT_ITEMS-WAERS  = G_T_FINAL-WAERS.
                LT_ITEMS-WTGBTR = L_AMOUNT1.
                LT_ITEMS-WKGBTR = L_AMOUNT1.
                APPEND LT_ITEMS.
                CLEAR: LT_ITEMS.
    * For reposting the Cost
                CHECK NOT LT_ITEMS[] IS INITIAL.
                CALL FUNCTION 'K40C_COBK_CHECK_POST'
                     CHANGING
                          ITCOBK                  = LS_COBK
                     EXCEPTIONS
                          PERIOD_BLOCKED          = 1
                          EXTERNAL_NUMBER_MISSING = 2
                          ERROR_OCCURED           = 3.
                IF SY-SUBRC IS INITIAL.
                  CALL FUNCTION 'K40C_DOCUMENT_LINE_CHECK'
                       EXPORTING
                            DOC_HEADER      = LS_COBK
                            IGNORE_WARNINGS = 'X'
                       TABLES
                            DOC_ITEMS       = LT_ITEMS.
    *...Create Tables for database
                  CALL FUNCTION 'K40C_DOCUMENT_CREATE'
                       EXPORTING
                            DOC_HEADER = LS_COBK
                       TABLES
                            DOC_ITEMS  = LT_ITEMS
                            ITCOEP     = LT_COEP
                            ITCOEPL    = LT_COEPL
                            ITCOEPR    = LT_COEPR.
                  CALL FUNCTION 'K40C_DOCUMENT_POST'
                       TABLES
                            ITCOEP     = LT_COEP
                            ITCOEPL    = LT_COEPL
                            ITCOEPR    = LT_COEPR
                       CHANGING
                            DOC_HEADER = LS_COBK.
                ENDIF.
              ENDIF.
              IF SY-SUBRC = 0.
                GET PARAMETER ID 'KBXXN_P_VAR_RKU1' FIELD CD_SEND_REC_REL.
                GET PARAMETER ID 'KBXX_START_DYNPRO' FIELD LD_STATUS.
                IF CD_SEND_REC_REL IS INITIAL AND LD_STATUS IS INITIAL.
                  CLEAR L_DYNNR.
                  L_DYNNR = '1220'.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'COHEADER-SEND_REC_REL'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=PVAR'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'L'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'RK23F-STATUS'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=LISI'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ENDIF.
                IF CD_SEND_REC_REL EQ '05SAP' AND LD_STATUS EQ 'S'.
                  CLEAR L_DYNNR.
                  L_DYNNR = '1220'.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ELSEIF CD_SEND_REC_REL EQ '05SAP' AND LD_STATUS EQ 'L'.
                  CLEAR L_DYNNR.
                  L_DYNNR = '1220'.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' L_DYNNR.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'RK23F-STATUS'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=LISI'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ELSEIF CD_SEND_REC_REL NE '05SAP' AND LD_STATUS EQ 'S'.
                  CASE CD_SEND_REC_REL.
                   WHEN '01SAP' OR '02SAP' OR '04SAP' OR '08SAP' OR '09SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1220'.
                    WHEN '03SAP' OR '07SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1230' .
                    WHEN '06SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1210'.
                    WHEN '10SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1270'.
                  ENDCASE.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' L_DYNNR.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'COHEADER-SEND_REC_REL'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=PVAR'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM BDC_FIELD       USING 'RK23F-WAERS'
                                                'EUR'.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ELSEIF CD_SEND_REC_REL NE '05SAP' AND LD_STATUS EQ 'L'.
                  CASE CD_SEND_REC_REL.
                   WHEN '01SAP' OR '02SAP' OR '04SAP' OR '08SAP' OR '09SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1220'.
                    WHEN '03SAP' OR '07SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1230' .
                    WHEN '06SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1210'.
                    WHEN '10SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1270'.
                  ENDCASE.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'COHEADER-SEND_REC_REL'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=PVAR'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'L'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'RK23F-STATUS'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=LISI'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ENDIF.
                CALL TRANSACTION 'KB11N' USING G_T_BDC MODE G_MODE MESSAGES
                                                          INTO G_T_MESSAGE.
                IF NOT G_T_MESSAGE[] IS INITIAL.
                  READ TABLE G_T_MESSAGE WITH KEY MSGTYP = 'S'.
                  IF SY-SUBRC = 0.
               DELETE FROM BALHDR WHERE LOGNUMBER = G_T_FINAL-LOGNUM    AND
                                           OBJECT = G_T_FINAL-OBJECT    AND
                                            SUBOBJECT = G_T_FINAL-SUBOBJECT.
                    COMMIT WORK.
                    G_T_TEMP = G_T_FINAL.
                    APPEND G_T_TEMP.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
            CLEAR G_T_MESSAGE.
            REFRESH G_T_MESSAGE.
    *refresh g_t_bdc.
            CLEAR G_T_BDC.
            REFRESH G_T_BDC.
          ENDIF.
      ENDCASE.
    ENDFORM.                    " USER_COMMAND
    Vasanth

  • Can we call a bdc program from a report?how

    hi
    experts can u help me for this

    Hi
    Yes, You can call a BDC program from Report.
    see the sample report in which it is used
    REPORT zm_reservation_alert
    NO STANDARD PAGE HEADING
    MESSAGE-ID zm_msg.
    D A T A B A S E T A B L E S D E C L A R A T I O N
    T Y P E S D E C L A R A T I O N S
    Reservations Main Structure
    TYPES: BEGIN OF s_res,
    rsnum TYPE rsnum, " Reservation No
    rspos TYPE rspos, " Item No
    usnam TYPE usnam, " User Name
    bwart TYPE bwart, " Movement Type
    aufnr TYPE aufnr, " Order Number
    rsart TYPE rsart, " Record Type
    bdart TYPE bdart, " Reservation Type
    matnr TYPE matnr, " Material No
    bdter TYPE bdter, " Req Date
    menge TYPE menge_d, " Quantity
    kostl TYPE kostl, " Cost Center
    usrid TYPE sysid, " User ID
    END OF s_res.
    Output Main Structure
    TYPES: BEGIN OF s_rep,
    usnam TYPE usnam, " User Name
    rsnum TYPE rsnum, " Reservation No
    rspos TYPE rspos, " Item No
    matnr TYPE matnr, " Material No
    bdter TYPE bdter, " Req Date
    menge TYPE menge_d, " Quantity
    kostl TYPE kostl, " Cost Center
    aufnr TYPE aufnr, " Order Number
    END OF s_rep.
    User Dept Details
    TYPES: BEGIN OF s_dept,
    pernr TYPE persno, " Personal No
    usrid TYPE sysid, " User ID
    orgeh TYPE orgeh, " Orgn Unit
    orgtx TYPE orgtx, " Dept Name
    END OF s_dept.
    For Send Mail Purpose
    DATA : i_doc_data LIKE sodocchgi1.
    DATA : BEGIN OF i_pack_list OCCURS 0.
    INCLUDE STRUCTURE sopcklsti1.
    DATA : END OF i_pack_list.
    DATA : BEGIN OF i_receivers OCCURS 0.
    INCLUDE STRUCTURE somlreci1.
    DATA : END OF i_receivers.
    DATA : BEGIN OF i_contents OCCURS 0.
    INCLUDE STRUCTURE solisti1.
    DATA : END OF i_contents.
    DATA : BEGIN OF i_header OCCURS 0.
    INCLUDE STRUCTURE solisti1.
    DATA : END OF i_header.
    DATA : BEGIN OF i_att OCCURS 0.
    INCLUDE STRUCTURE solisti1.
    DATA : END OF i_att.
    Internal table for bdcdata
    DATA : it_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    Internal table to handle messages
    DATA : it_messages LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    D A T A D E C L A R A T I O N S
    DATA: gv_lines TYPE sy-index, " Total Lines int Table
    gv_days TYPE i, " Difference Days
    gv_date TYPE sy-datum, " Date
    gv_date1 TYPE sy-datum, " Date
    gv_date2 TYPE sy-datum, " Date
    gv_text(85), " Text Field
    gv_mesg(70), " Error Messages
    gv_bdc, " BDC Flag
    gv_flag TYPE i, " Flag
    gv_ernam TYPE ernam. " User ID
    C O N S T A N T S D E C L A R A T I O N S
    CONSTANTS: c_x VALUE 'X', " Flag
    c_endda TYPE endda VALUE '99991231'. " Date
    I N T E R N A L T A B L E S D E C L A R A T I O N S
    DATA: i_res TYPE STANDARD TABLE OF s_res WITH HEADER LINE, " Reservns
    i_dept TYPE STANDARD TABLE OF s_dept WITH HEADER LINE, " Dept
    i_rep TYPE STANDARD TABLE OF s_rep WITH HEADER LINE. " Output
    S T A R T - O F - S E L E C T I O N *
    START-OF-SELECTION.
    Fetch main data
    PERFORM fetch_data.
    Process data
    PERFORM process_data.
    *& Form fetch_data
    Fetching the Reservations related data from Database Tables
    FORM fetch_data .
    CLEAR: gv_date, gv_date1, gv_date2.
    gv_date = sy-datum.
    gv_date1 = sy-datum - 10.
    gv_date2 = sy-datum + 10.
    CLEAR i_res.
    REFRESH i_res.
    SELECT a~rsnum " Reservation No.
    b~rspos " Reservation Item
    a~usnam " User Name
    a~bwart " Movement Type
    a~aufnr " Order Number
    b~rsart " Record Type
    b~bdart " Reservation Type
    b~matnr " Material No
    b~bdter " Req Date
    INTO TABLE i_res
    FROM rkpf AS a JOIN resb AS b
    ON arsnum = brsnum
    WHERE ( b~bdter BETWEEN gv_date1 AND gv_date2 ) AND
    b~xloek EQ ' '.
    SORT i_res BY rsnum rspos.
    DELETE ADJACENT DUPLICATES FROM i_res COMPARING matnr.
    Add userid into the i_usr int table
    LOOP AT i_res.
    i_res-usrid = i_res-usnam.
    MODIFY i_res INDEX sy-tabix.
    ENDLOOP.
    IF NOT i_res[] IS INITIAL.
    Get the User Dept Name
    CLEAR i_dept.
    REFRESH i_dept.
    SELECT a~pernr " Personal No
    a~usrid " User ID
    b~orgeh " Orgn Unit
    c~orgtx " Dept Name
    INTO TABLE i_dept
    FROM pa0105 AS a JOIN pa0001 AS b
    ON apernr = bpernr JOIN t527x AS c
    ON borgeh = corgeh
    FOR ALL ENTRIES IN i_res
    WHERE a~usrid = i_res-usrid AND
    a~endda EQ c_endda AND
    b~endda EQ c_endda.
    ENDIF.
    SORT i_dept BY pernr.
    DELETE ADJACENT DUPLICATES FROM i_dept COMPARING pernr.
    Move the Creator of Reservation to a diff table
    LOOP AT i_res.
    MOVE-CORRESPONDING i_res TO i_rep.
    APPEND i_rep.
    CLEAR i_rep.
    ENDLOOP.
    SORT i_rep BY usnam rsnum rspos.
    ENDFORM. " Fetch_Data
    *& Form process_data
    Process the Reservations related data for Expiry Date
    FORM process_data .
    DATA: lv_date1 LIKE sy-datum,
    lv_date2 LIKE sy-datum,
    lv_date3(10),
    lv_menge(13),
    lv_tabix LIKE sy-tabix.
    LOOP AT i_rep.
    CLEAR: gv_days, gv_text, lv_date1, lv_date2,lv_date3.
    lv_tabix = sy-tabix.
    AT NEW usnam.
    Populate the Contents Table
    CLEAR i_att.
    REFRESH i_att.
    i_att = 'Reservations Reminder'(014).
    APPEND i_att.
    i_att = '----
    APPEND i_att.
    i_att-line = ' '.
    APPEND i_att.
    READ TABLE i_dept WITH KEY usrid = i_rep-usnam.
    CONCATENATE 'Name:'(003) i_rep-usnam 'Dept:'(015) i_dept-orgtx
    INTO i_att-line SEPARATED BY space.
    APPEND i_att.
    i_att-line = ' '.
    APPEND i_att.
    i_att = 'Please find the List of expiring Reservations'(004).
    APPEND i_att.
    i_att-line = ' '.
    APPEND i_att.
    CONCATENATE '--' '' '--
    ' INTO
    i_att-line SEPARATED BY space.
    APPEND i_att.
    CONCATENATE 'Reservation #'(006) 'Material #'(007) ' Quantity'(002)
    'Due Date'(008) 'Work Center/CC'(005) INTO
    i_att-line SEPARATED BY space.
    APPEND i_att.
    CONCATENATE '--' '' '--
    ' INTO
    i_att-line SEPARATED BY space.
    APPEND i_att.
    i_att-line = ' '.
    APPEND i_att.
    ENDAT.
    gv_days = i_rep-bdter - gv_date.
    lv_date1 = i_rep-bdter + 5.
    lv_date2 = i_rep-bdter + 10.
    MOVE i_rep-menge TO lv_menge.
    WRITE i_rep-bdter TO lv_date3.
    IF gv_days = 10.
    IF i_rep-aufnr <> space.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-aufnr 'is due for 10 days. Please collect'(009)
    INTO gv_text SEPARATED BY space.
    ELSE.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-kostl 'is due for 10 days. Please collect'(009)
    INTO gv_text SEPARATED BY space.
    ENDIF.
    i_att-line = gv_text.
    APPEND i_att.
    CLEAR i_att.
    CLEAR gv_text.
    ENDIF.
    IF gv_days = 5.
    IF i_rep-aufnr <> space.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-aufnr 'is due for 5 days. Please collect'(010)
    INTO gv_text SEPARATED BY space.
    ELSE.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-kostl 'is due for 5 days. Please collect'(010)
    INTO gv_text SEPARATED BY space.
    ENDIF.
    i_att-line = gv_text.
    APPEND i_att.
    CLEAR i_att.
    CLEAR gv_text.
    ENDIF.
    IF gv_date = lv_date1.
    IF i_rep-aufnr <> space.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-aufnr 'is getting cancelled on'(011) lv_date2
    INTO gv_text SEPARATED BY space.
    ELSE.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-kostl 'is getting cancelled on'(011) lv_date2
    INTO gv_text SEPARATED BY space.
    ENDIF.
    i_att-line = gv_text.
    APPEND i_att.
    CLEAR i_att.
    CLEAR gv_text.
    ENDIF.
    IF gv_date = lv_date2.
    IF i_rep-aufnr <> space.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-aufnr 'is being cancelled'(012)
    INTO gv_text SEPARATED BY space.
    ELSE.
    CONCATENATE i_rep-rsnum i_rep-matnr lv_menge lv_date3
    i_rep-kostl 'is being cancelled'(012)
    INTO gv_text SEPARATED BY space.
    ENDIF.
    i_att-line = gv_text.
    APPEND i_att.
    CLEAR i_att.
    CLEAR gv_text.
    Mark the Reservation Item 'DELETED' using BDC.
    UPDATE resb SET xloek = c_x.
    PERFORM delete_item_resb.
    ENDIF.
    AT END OF usnam.
    IF ( gv_days = 10 OR gv_days = 5 OR gv_date = lv_date1 OR
    gv_date = lv_date2 ).
    Read the User who creates the Reservn and send a mail alert to him
    CLEAR : i_receivers,gv_ernam.
    REFRESH: i_receivers.
    READ TABLE i_rep INDEX lv_tabix.
    gv_ernam = i_rep-usnam.
    IF gv_ernam <> space.
    Send mail Alert to PR Creator(SAP inbox)
    PERFORM send_alert_data.
    Send Mail to External Mail ID of the SAP USER
    PERFORM send_mail_external.
    ENDIF.
    ENDIF.
    ENDAT.
    ENDLOOP.
    ENDFORM. " Process_data
    *& Form delete_item_resb
    Set the Deletion Indicator for the Res. Item in RESB
    FORM delete_item_resb.
    gv_bdc = 'N'.
    Perform to fill it_bdcdata.
    PERFORM fill_it_bdcdata.
    Call the Transaction MB22
    CALL TRANSACTION 'MB22' USING it_bdcdata MODE 'A' UPDATE 'S'
    MESSAGES INTO it_messages.
    IF sy-subrc <> 0.
    gv_flag = 1.
    If error occurs in transaction mode run bdc session for that data
    PERFORM bdc_process.
    ENDIF.
    Handles error messages
    PERFORM error_messages.
    CLEAR : it_bdcdata, it_messages.
    REFRESH : it_bdcdata, it_messages.
    IF gv_bdc = 'O'.
    close bdc if it is open
    PERFORM close_bdc.
    ENDIF.
    ENDFORM. "delete_item_resb
    *& Form FILL_IT_BDCDATA
    Filling Bdcdata structure with data
    FORM fill_it_bdcdata.
    PERFORM bdc_dynpro USING 'SAPMM07R' '0560'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RM07M-RSPOS'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'RM07M-RSNUM'
    i_rep-rsnum.
    PERFORM bdc_field USING 'RM07M-RSPOS'
    i_rep-rspos.
    PERFORM bdc_dynpro USING 'SAPMM07R' '0510'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RESB-XLOEK'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'RESB-XLOEK'
    c_x.
    PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'COBL-KOSTL'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTE'.
    PERFORM bdc_dynpro USING 'SAPMM07R' '0510'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RESB-ERFMG'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=BU'.
    PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'COBL-KOSTL'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ENTE'.
    ENDFORM. " FILL_IT_BDCDATA
    *& Form BDC_DYNPRO
    Filling the it_bdcdata table with program name & screen number
    FORM bdc_dynpro USING program LIKE bdcdata-program
    dynpro LIKE bdcdata-dynpro.
    it_bdcdata-program = program.
    it_bdcdata-dynpro = dynpro.
    it_bdcdata-dynbegin = 'X'.
    APPEND it_bdcdata.
    CLEAR it_bdcdata.
    ENDFORM. " BDC_DYNPRO
    *& Form BDC_FIELD
    Filling it_bdcdata with field name and field value
    FORM bdc_field USING fnam LIKE bdcdata-fnam
    fval.
    it_bdcdata-fnam = fnam.
    it_bdcdata-fval = fval.
    APPEND it_bdcdata.
    CLEAR it_bdcdata.
    ENDFORM. " BDC_FIELD
    *& Form ERROR_MESSAGES
    Displaying error messages
    FORM error_messages.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    id = sy-msgid
    lang = sy-langu
    IMPORTING
    msg = gv_mesg
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    LOOP AT it_messages WHERE msgtyp = 'E'.
    WRITE : / 'Message :'(001) ,gv_mesg.
    CLEAR it_messages.
    ENDLOOP.
    ENDFORM. " ERROR_MESSAGES
    *& Form BDC_PROCESS
    Open bdc session if call transaction fails
    FORM bdc_process.
    IF gv_bdc = 'N'.
    open bdc session
    PERFORM open_bdc.
    gv_bdc = 'O'.
    ENDIF.
    IF gv_bdc = 'O'.
    insert data into bdc session
    PERFORM insert_bdc.
    ENDIF.
    ENDFORM. " BDC_PROCESS
    *& Form OPEN_BDC
    Calling function module to open bdc session
    FORM open_bdc.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    client = sy-mandt
    group = 'ZMM'
    keep = 'X'
    user = sy-uname
    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.
    ENDFORM. " OPEN_BDC
    *& Form INSERT_BDC
    Insert it_bdcdata into bdc by calling function module bdc_insert
    FORM insert_bdc.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    tcode = 'MB22'
    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.
    ENDFORM. " INSERT_BDC
    *& Form CLOSE_BDC
    Closing bdc session
    FORM close_bdc.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    not_open = 1
    queue_error = 2
    OTHERS = 3.
    ENDFORM. " CLOSE_BDC
    *& Form send_alert_data
    Send Alert for the Expired Contract
    FORM send_alert_data .
    CLEAR: gv_lines,i_receivers, i_header, i_contents,i_doc_data.
    REFRESH : i_receivers,i_header,i_contents.
    DESCRIBE TABLE i_att LINES gv_lines.
    i_receivers-receiver = gv_ernam.
    i_receivers-receiver = 'SSHEIK'.
    i_receivers-rec_type = 'B'.
    i_receivers-rec_date = sy-datum.
    i_receivers-express = 'X'.
    i_receivers-com_type = 'INT'.
    i_receivers-notif_del = 'X'.
    APPEND i_receivers.
    i_doc_data-obj_name = 'SAPoffice'(013).
    i_doc_data-obj_descr = 'Reservations Reminder'(014).
    i_doc_data-obj_langu = 'E'.
    i_doc_data-no_change = c_x.
    i_doc_data-obj_prio = 1.
    i_doc_data-priority = 1.
    i_doc_data-doc_size = ( gv_lines - 1 ) * 255 + 135.
    i_pack_list-transf_bin = c_x.
    i_pack_list-head_start = '1'.
    i_pack_list-head_num = '1'.
    i_pack_list-body_start = '1'.
    i_pack_list-body_num = gv_lines.
    i_pack_list-doc_type = 'DOC'.
    i_pack_list-obj_name = 'SAPoffice'(013).
    i_pack_list-obj_descr = 'Reservations Reminder'(014).
    i_pack_list-obj_langu = 'E'.
    i_pack_list-doc_size = ( gv_lines - 1 ) * 255 + 135.
    APPEND i_pack_list.
    i_header-line = 'Header'. APPEND i_header.
    Data for contents
    i_contents-line = 'Please find the Reservations Due List'(016).
    APPEND i_contents.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = i_doc_data
    PUT_IN_OUTBOX = 'X'
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    packing_list = i_pack_list
    object_header = i_header
    contents_bin = i_att
    contents_txt = i_contents
    receivers = i_receivers
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8.
    IF sy-subrc = 0.
    MESSAGE i000 WITH 'Mail Sucessfully sent'(017).
    ELSE.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " send_alert_data
    *& Form send_mail_external
    Send mail to External MAIL ID of the PR Creator
    FORM send_mail_external.
    DATA : lv_str(24), lv_str1(40),
    lv_pernr LIKE adr6-persnumber,
    lv_adrnr LIKE adr6-addrnumber,
    lv_usrid LIKE pa0105-usrid,
    lv_mail LIKE adr6-smtp_addr,
    lv_sendor TYPE syuname,
    lv_receiver TYPE string,
    lv_header TYPE string,
    lv_body TYPE string.
    CLEAR: lv_pernr, lv_usrid, lv_adrnr,
    lv_mail, lv_sendor, lv_receiver,
    lv_header, lv_body .
    lv_usrid = gv_ernam.
    SELECT SINGLE persnumber addrnumber FROM usr21
    INTO (lv_pernr,lv_adrnr)
    WHERE bname = lv_usrid.
    IF sy-subrc = 0.
    SELECT SINGLE smtp_addr INTO lv_mail FROM adr6
    WHERE addrnumber = lv_adrnr AND
    persnumber = lv_pernr.
    IF sy-subrc <> 0.
    CONCATENATE lv_usrid '@anc.com' INTO lv_mail.
    lv_receiver = lv_mail.
    ELSE.
    lv_receiver = lv_mail.
    ENDIF.
    lv_receiver = '[email protected]'.
    lv_sendor = 'JALKHATAM'.
    lv_header = 'Reservations Reminder'(014).
    lv_str = 'Pls check your SAP Inbox'(019).
    lv_str1 = 'for the status of Reservations Due List'(020).
    CONCATENATE lv_str lv_str1 INTO lv_body
    SEPARATED BY space.
    Call Function Module To send mail
    CALL FUNCTION 'UWSP_SEND_MAIL_TO_WEB'
    EXPORTING
    id_header = lv_header
    id_body = lv_body
    id_receiver = lv_receiver
    id_sender = lv_sendor
    ID_HTML_MAIL =
    id_commit_work = 'X'
    EXCEPTIONS
    error = 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.
    ENDIF.
    ENDFORM. " send_mail_external
    <b>Reward points for useful Answers</b>
    Regards
    Ashu

  • Can we call a bdc program from report program

    hi
    can we call a bdc program from report program

    Yes you can any program from another program using
    SUBMIT <repname>   statement
    SUBMIT <repname> USING SELECTION-SCREEN dynnr.
    or
    SUBMIT <repname> VIA SELECTION-SCREEN USING SELECTION-SET variant
    SUBMIT <repname> VIA SELECTION-SCREEN WITH SELECTION-TABLE rspar
    etc.
    Regards
    Prax

  • Exception while calling a BDC from webdynpro

    Hi All,
    I am getting an exception 'Exception condition "CNTL_ERROR" raised' while calling a BDC from the WD application, though i am calling the transaction in background mode. The statment which was throwing the exception was a create object statement in the function module DOC_DISPLAY_INITIALIZE. Can u please tell me, what is the reason for this?
    Thanks in Advance,
    Laxmikanth

    >
    amit saini wrote:
    > hi ,
    > The message "CNTL_ERROR" appear when you are using some of  the SAP enjoy transaction code like ME21N / ME22N / ME23N.
    >
    > This are bugs cause by the earlier version of the SAPGUI. It  usually occurs when you are running a BDC session
    > for a transaction that has 'fancy' screen elements like table controls ortabstrips. These work fine in the foreground, but not so well in the background.
    >
    >
    > To solve it, goto OSS and apply the SAPGUI's latest front end patch to your PC.
    >
    > rgds,
    > amit
    There is a mixture of accurate information here.
    This is NOT a SAPGUI problem.  It can not be fixed with a newer version fo the SAPGUI.  It is caused by transactions that were created with Enjoy Controls.  Enjoy controls are not the table control or the tabstrip.  They are controls that used ActiveX components on the desktop as part of the SAPGUI - like the ALV Grid, the Tree, the ABAP Editor, etc. 
    You can not use call transaction/BDC against such transactions in the background or in WDA because there is no connection to the frontend to create instances of these controls.  These transactions with the enjoy controls should have appropriate BAPIs or Enterprise Services that you should call instead in order to make data updates or creations.
    For instance see SAP Note 304122 that discusses this issue for transaction MIGO.

  • Help in call transction

    Hi
    How can i call transction with parameters
    thanks
    have a nice day

    Hi
    data: ctumode like ctu_params-dismode value 'N'.
    data: cupdate like ctu_params-updmode value 'L'.
    data: bdcdata like bdcdata    occurs 0 with header line.
    data: messtab like bdcmsgcoll occurs 0 with header line.
    perform create_transaction using 'MB1A'.
    form create_transaction using    tcode.
    call transaction tcode using bdcdata
                          mode   ctumode
                          update cupdate
                          messages into messtab.
    endform.
    Thanks
    venki

  • Skip user exit call at BDC run.

    Hi All,
    1)  I have a BDC program that updates email addresses for existing sales orders & contracts in T-code VA02 & VA42.
    2)  In include MV45AFZZ i have added a piece of code that raises a pop-up message for those items whose profit centre is not   maintained.
    It's a genuine case that my BDC won't execute successfully for those sales orders where profit centre is not maintained for its items. The reason the pop-up message is displayed and BDC won't skip that.
    Note : I could have used warning/information message but due to some constraints i used the pop up message. I wanted a message to be displayed with all the line items missing their respective profit centres. The message was displayed but the screen was greyed out i.e. in display mode. So i used pop up message and handled the screen accordingly.
    The main issue now is:
    My BDC won't work as the pop-up message cannot be skipped by the BDC . Can you suggest something
    1) So that the code in the user exit won't be trigerred at the BDC call or BDC run?
                                                              OR
    2) Pop-up should only be displayed when user works with T-code VA02 or VA42 and not at BDC run
    ~Arya.

    Hi,
    Please check for the system parameter sy-binpt.
    for eg:
    IF SY-BINPT NE  'X'
    CODe.....
    ENDIF.
    Thanks & Regards
    Suresh Krishnan
    Edited by: Suresh Krishnan on Jan 30, 2012 12:06 PM
    Edited by: Suresh Krishnan on Jan 30, 2012 12:06 PM
    Edited by: Suresh Krishnan on Jan 30, 2012 12:06 PM
    Edited by: Suresh Krishnan on Jan 30, 2012 12:07 PM
    Edited by: Suresh Krishnan on Jan 30, 2012 12:07 PM

  • Calling a BDC program in side a user-exit

    Hi all,
    I need to call a BDC program in side a user-exit of sales order change
    . i want to make user by calling this BDC program that it wont effect any of my other code's on that and that the customer wont be noticed with any inconvenience.
    i know to use
    CALL TRANSACTION 'zprogram'.
    but i want to make sure that till will not do any harm for any of other parts.
    Regards Nafran.

    Hi
    Make sure you dont change any values of standard SAP variables,structures and internal table values inside the user exit.This is the only way where the other functionality gets affected(unless it is the requirement).
    Reward if helpful.
    Thanks & regards,
    Ramya

  • Call Trasaction (BDC for CRMD_ORDER) in webui

    Hi Experts,
    I know this is not a good option to use a call transaction in webui nad we are gettinCNTL_ERROR for that too.
    Our requirement is like , from custom webui report we are wants to call the BDC with some data based on the inputs.
    But here we are getting an error for the statement Call Transaction.
    Is it possible to use anyway/ or not allowed in webui......
    please suggets alternative.......
    Thanks,
    Aniket

    Hi,
    You cannot use CALL TRANSACTION in Web UI. If you want to display standard transaction you'd have to use transaction launcher.
    Let me know if you need more help.
    Regards
    Prasenjit

  • Error on calling a BDC from web dynpro while it runs fine through FM.

    I have created a function module for calling transaction ima2n using a BDC. This function module runs as intended, if function module is executed using SE37. if I call the same function module from ABAP dynpro view, on some event. I get the below error. I have debugged the function module but it runs fine. If i debug function module and run the BDC in mode "A" then i can see that BDC is performing the intended actions. This is a strange behaviour.. Please help.
    ABAP Dynpro Error
    Error when processing your request
    What has happened?
    The URL http://dev.corp.bharatpetroleum.com:8000/sap/bc/webdynpro/sap/zcapex_appln/ was not called due to an error.
    Note
    The following error text was processed in the system D01 : Exception condition "CREATE_ERROR" raised.
    The error occurred on the application server dev_D01_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Function: TREEV_CREATE_COLUMN_TREE of program SAPLCNT4
    Form: TVAR_INIT of program SAPLAIA1
    Module: INIT_VARIANTEN_TREE of program SAPLAIA1
    What can I do?
    If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system D01 in transaction ST22.
    If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server dev_D01_00 in transaction SM21.
    If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server dev_D01_00 . In some situations, you may also need to analyze the trace files of other work processes.
    If you do not yet have a user ID, contact your system administrator.
    Error code: ICF-IE-http -c: 100 -u: TESTAUTH32 -l: E -s: D01 -i: dev_D01_00 -w: 0 -d: 20111109 -t: 123625 -v: RABAX_STATE -e: RAISE_EXCEPTION
    HTTP 500 - Internal Server Error
    Your SAP Internet Communication Framework Team
    ST22 Dump screen
    User and Transaction
        Client.............. 100
        User................ "TESTAUTH32"
        Language Key........ "E"
        Transaction......... "IMA2N "
        Transactions ID..... "4EB9F7AE3E2403D7E10000000A481584"
        Program............. "SAPLCNT4"
        Screen.............. "SAPLAIA1 0306"
        Screen Line......... 5
        Information on Caller ofr "HTTP" Connection:
        Plug-in Type.......... "HTTP"
        Caller IP............. "10.72.46.106"
        Caller Port........... 8000
        Universal Resource Id. "/sap/bc/webdynpro/sap/zcapex_appln/"
    Information on where terminated
        Termination occurred in the ABAP program "SAPLC
         "TREEV_CREATE_COLUMN_TREE".
        The main program was "SAPLAIA1 ".
        In the source code you have the termination poi
        of the (Include) program "LCNT4U74".
    Error occurred during batch input processing
    Source Code :
                    CONTAINER
                 CHANGING
                    HANDLE
                    TREE_CONTROL_NOT_EXISTING
                    FAILED
                    CREATE_ERROR
                    CNTL_SYSTEM_ERROR.
    IF NOT TREE_CONTROL_NOT_EXISTING IS INITIAL
       RAISE TREE_CONTROL_NOT_EXISTING.
    ELSEIF NOT FAILED IS INITIAL.
       RAISE FAILED.
    ELSEIF NOT CREATE_ERROR IS INITIAL.
       -->>>>>>>>>RAISE CREATE_ERROR. " failed on this line
    ELSEIF NOT CNTL_SYSTEM_ERROR IS INITIAL.
       RAISE CNTL_SYSTEM_ERROR.
    ENDIF.
    regards,
    Parag Agrawal

    Hi,
    as BDC is calling screens and in Webdynpro ABAP you cannot use SAP GUI sceeen, you are getting short dump.
    Refer CNTL_SYSTEM_ERROR in webservices from r/3 system
    Thanks,
    Chandra

  • Call transaction BDC with different user id

    Hello,
    We have a BDC program for creating Invoice using "CALL TRANSACTION VF01" method. But there are are few user IDs accessing this program who do not have authorisation to VF01. So requirement is to create Invoice with a common user id.
    Please help if it is possible to call transaction with different user id. Please also provide you inputs if you can suggest some other way to fulfill this requirement.
    Thanks & Regards,
    Rohit

    Hi Rohit,
    if users are not authorized to post invoice, why is it required to surpass the checks?
    A Question the business should answer.
    It should not be the consultants obligation to find doubtable ways.
    Regards
    Clemens

  • Multiple Transaction Calling in BDC

    Hi Friends,
    The Requirement is related to MI01,MI04,MI07 BDC is required for these transactions with in a single program is it possible through CALL-TRANSACTION mothod or we have to go for the SESSION method please suggest in that way to resolve the issue and send me the example code also.
    Thanks in advance.

    Madan,
    You will have to prepare the BDC information for each transaction separately and call the transactions separately.
    However if you are creating a batch input session, you can have different transactions inserted into it. So you will do BDC_OPEN_GROUP for creating the session, and then do BDC_INSERT for inserting transaction MI01, another BDC_INSERT for MI04 and another BDC_INSERT for MI07 . Make sure that you refresh your BDCDATA internal table after each call.
    Don't forget to reward if useful.

Maybe you are looking for