Call or Execute, ABAP program with variant

REPORT Z_call_ABAP_program  NO STANDARD PAGE HEADING.
TABLES : BKPF , INDX.
PARAMETERS : ZBUKRS LIKE BKPF-BUKRS OBLIGATORY DEFAULT '0001',
                             ZGJAHR LIKE BKPF-GJAHR OBLIGATORY DEFAULT '1995'.
SELECT-OPTIONS : ZPERIOD FOR BKPF-MONAT OBLIGATORY.
DATA : BEGIN OF CHECK_TAB OCCURS 100,
                 CLIENT LIKE BSEG-MANDT ,
                 COMPANY LIKE BKPF-BUKRS ,
                 FINYR LIKE BKPF-GJAHR ,
                 MONAT LIKE BKPF-MONAT ,
                 LDDT LIKE BKPF-CPUDT ,
             END OF CHECK_TAB.
DATA : BEGIN OF CHECK_TABO OCCURS 100,
                  CLIENT LIKE BSEG-MANDT ,
                  COMPANY LIKE BKPF-BUKRS ,
                  FINYR LIKE BKPF-GJAHR ,
                  MONAT LIKE BKPF-MONAT ,
                  LDDT LIKE BKPF-CPUDT ,
              END OF CHECK_TABO.
DATA : BEGIN OF CT_KEY ,
                  CLIENT LIKE BSEG-MANDT ,
                  COMPANY LIKE BKPF-BUKRS ,
                  FINYR LIKE BKPF-GJAHR ,
                  MONAT LIKE BKPF-MONAT ,
                  LDDT LIKE BKPF-CPUDT ,
               END OF CT_KEY.
START-OF-SELECTION.
IMPORT CHECK_TAB FROM DATABASE INDX(VP) ID 'CDSDATE'.
LOOP AT CHECK_TAB.
      MOVE-CORRESPONDING CHECK_TAB TO CHECK_TABO. APPEND CHECK_TABO.
ENDLOOP.
LOOP AT CHECK_TAB.
     IF CHECK_TAB-FINYR = ZGJAHR AND CHECK_TAB-MONAT IN ZPERIOD AND
          CHECK_TAB-COMPANY = ZBUKRS.
          CLEAR CT_KEY.
           MOVE: CHECK_TAB-CLIENT TO CT_KEY-CLIENT ,
           CHECK_TAB-COMPANY TO CT_KEY-COMPANY,
           CHECK_TAB-FINYR TO CT_KEY-FINYR ,
            CHECK_TAB-MONAT TO CT_KEY-MONAT ,
            CHECK_TAB-LDDT TO CT_KEY-LDDT.
            EXPORT : CHECK_TAB CT_KEY TO MEMORY.
            SUBMIT ZCDSDTUP
                      WITH YCLIENT = SY-MANDT
                      WITH YCOMPANY = ZBUKRS
                      WITH YFINYR = ZGJAHR
                      WITH YMONAT = CHECK_TAB-MONAT
                      WITH YLDDT = CHECK_TAB-LDDT
                      VIA SELECTION-SCREEN AND RETURN.
               IMPORT CHECK_TAB FROM MEMORY .
        ENDIF.
ENDLOOP. 
SKIP 2.
WRITE :/2 'Position Before Update'. ULINE /2(53).
WRITE :/4 'Client' , 11 'Comp.' , 18 'Fin.Yr.' , 27 'Period' ,
35 'Data Downloaded upto'. SKIP 1.
LOOP AT CHECK_TABO.
     IF CHECK_TABO-FINYR = ZGJAHR AND CHECK_TABO-MONAT IN ZPERIOD AND
         CHECK_TABO-COMPANY = ZBUKRS.
         WRITE :/5 CHECK_TABO-CLIENT,11 CHECK_TABO-COMPANY,19 CHECK_TABO-FINYR,
                      29 CHECK_TABO-MONAT, 38 CHECK_TABO-LDDT.
      ENDIF.
ENDLOOP.
SKIP 3.
WRITE :/2 'Position After Update'. ULINE /2(53).
WRITE :/4 'Client' , 11 'Comp.' , 18 'Fin.Yr.' , 27 'Period' , 35 'Data Downloaded upto'. SKIP 1.
LOOP AT CHECK_TAB.
     IF CHECK_TAB-FINYR = ZGJAHR AND CHECK_TAB-MONAT IN ZPERIOD AND
          CHECK_TAB-COMPANY = ZBUKRS.
          WRITE :/5 CHECK_TAB-CLIENT ,11 CHECK_TAB-COMPANY , 19 CHECK_TAB-FINYR,
                       29 CHECK_TAB-MONAT , 38 CHECK_TAB-LDDT.
     ENDIF.
ENDLOOP.
SKIP 3. ULINE.
WRITE :/7 'PLEASE CONFIRM CAREFULLY THE ABOVE DATES ' ,
               /5 'BEFORE RUNNING THE DATA DOWNLOAD PROGRAM FOR CDS.'.
EXPORT CHECK_TAB TO DATABASE INDX(VP) ID 'CDSDATE'.

You will haev to add the varaint also in the object entry in the transport request.
For this
goto Se38 - > select progfram - > click on radio button for varaints - > Cick on Display - > Utilities -> transport request - >  and execute.
This wil include the varaint also with the program name in the transport request and allow you to directly execute the program after transport to be executed with a varaint.
Regards,
Mansi.

Similar Messages

  • How to call subroutines defined in ABAP program with type S

    how to call subroutines defined in ABAP program with type S? can you give an example?

    Normal executable program,
    REPORT  ZTEST_MAIN.
    perform sub1 in program ztest_sub.
    "you can call using in program addition
    Subroutine pool program
    PROGRAM  ZTEST_SUB.
    form sub1.
    endform.

  • How do we call smartforms in abap program or web services

    how do we call smartforms in abap program or web services
    How many types of smartforms are there?
    points will be rewarded

    Hi
    See this sample program
    Using the fun module smartform is called from the program
    Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    <b>call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'</b>
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function <b>FM_NAME</b>
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    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 points for useful Answers</b>
    Regards
    Anji

  • Executing ABAP program in RFC to File

    Hi,
    In the RFC to File, the RFc is called in the ABAP program.
    So when i am executing the ABAP program for the 1st time it doesnt reach PI, only when clicking the execute button multiple times execution reaches PI and a message ID is created along with the required data.
    what is the problem? why is it not reaching PI when i execute at the first time itself?

    Hi Ravi,
    Thanks for the response.
    >>> First u have check RFC destinatios wheter it working or not. 1) U r program ID should match with RFc destination and RFC adapter configurations.
    I have tested the RFC destinations and it works fine. I have also given the same Program ID in adapter configuration
    >>>2)should write commit work at last in the Abap Program.
    Commit is present at the end of the ABAP program
    Cache refresh was also done. But still facing the same problem.
    >>>5)Check in SM58 .
    And we are getting the following errors randomly:
    Server repository could not create function template for 'ZFN_EXTRACT
    Commit fault: com.sap.aii.adapter.rfc.afcommunication.RfcChannelMismatchE

  • Error in executing ABAP program. Error occurred when creating dataset

    hi,
    when I use LKM SAP ERP to Oracle (SQLLDR) to extract data from SAP ERP server. I execute my interface, and it's stop at extract data step.
    This is message:
    java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset/abc/ZODI_13001_6001_GLOBAL.txt
    I tried others path name, tried slash or backslash. This is content in code tab
    OdiSAPAbapExecute "-UPLOAD=1" "-EXECUTE=1" "-EXECUTEBASE_RKM=0" "-ZRFC_RUN_INSTALL=1" "-ABAP_PROGRAM_NAME=ZODI_13001_6001" "-HOST=10.86.87.24" "-USER=sv_hoa" "-PASSWORD=<@=snpRef.getInfo("SRC_PASS") @>" "-SAP_CLIENT=800" "-SAP_LANGUAGE=EN" "-SAP_SYSTEM_NUMBER=02" "-SAP_FUNCTION_GROUP_NAME=ZODI_FGR_13001" "-CONNECTION_POOL_NAME=SAP_ODI_ERP_POOL_10.86.87.24" "-CONNECTION_POOL_SIZE=10" "-FILE_DELIMITER=<@=""+(char)8@>" "-FILE_NAME=ZODI_13001_6001_GLOBAL.txt" "-FTP_HOST=10.86.82.108" "-FTP_USER=anh" "-FTP_PASSWORD=<@=sFtpPassword@>" "-FTP_PASSIVE_MODE=1" "-FTP_TRANSFER_TIMEOUT=100000" "-ODI_VARIABLE_NAMES=" "-ODI_VARIABLE_VALUES=" "-USER_ABAP_PARAMETER_NAMES=IV_DELIMITER,CHAR3;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_MAX_ROW_CNT,SYTABIX;IV_FETCH_BATCH_SIZE,SYTABIX;" "-USER_ABAP_PARAMETER_VALUES=<Value>" "-USER_ABAP_PARAMETER_SEPARATOR=<Value>" "-ABAP_TABLE_PARAMETERS=RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2" "-ABAP_EXPORT_PARAMETERS=ERRORMESSAGE;SY-MSGV1" "-LOG_FILE_NAME=C:\Users\anh\AppData\Local\Temp\SapAbapExecuteOpenTool_13001.log" "-FTP_PATH=/abc/" "-DEV_CLASS=ZODI_DEVCLASS" "-MAX_ROW_COUNT=" "-FETCH_BATCH_SIZE=100000" "-HASH_VALUE_MARKER=HVM" "-ABAP_PROGRAM_BODY=
    *Final Type declarations
    TYPES : BEGIN OF ty_final,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final.
    *Final Temp Type Declarations
    TYPES : BEGIN OF ty_final_tmp,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID ,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH ,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH ,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH ,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI ,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU ,
    END OF ty_final_tmp.
    *Final Target Type Declarations
    TYPES : BEGIN OF ty_final_target,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final_target.
    * Table type for Y03HOCSINH
    TYPES : BEGIN OF ty_Y03HOCSINH,
    HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_Y03HOCSINH.
    TYPES: BEGIN OF gs_text,
    line(843) TYPE c,
    END OF gs_text.
    *Structure Declarations
    DATA: wa_final_string TYPE string,
    wa_final TYPE ty_final,
    wa_final_target TYPE ty_final_target,
    wa_Y03HOCSINH TYPE ty_Y03HOCSINH,
    *Table Declarations
    tt_final TYPE STANDARD TABLE OF ty_final,
    tt_Y03HOCSINH TYPE STANDARD TABLE OF ty_Y03HOCSINH,
    tt_final_target TYPE STANDARD TABLE
    OF ty_final_target,
    tt_final_tmp TYPE STANDARD TABLE OF ty_final_tmp,
    tt_final_tmp1 TYPE STANDARD TABLE OF ty_final,
    gt_result TYPE STANDARD TABLE OF gs_text,
    *Variable Declarations
    lv_path TYPE string,
    lv_flag TYPE char1,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    STRING,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    STRING,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    STRING,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    STRING,
    C4_Y03HOCSINH_DIA_CHI TYPE
    STRING,
    C5_Y03HOCSINH_GHI_CHU TYPE
    STRING,
    wa_final_tmp TYPE ty_final_tmp,
    lv_file TYPE string,
    lv_datum TYPE sy-datum,
    lv_date TYPE char10,
    wa_result TYPE string,
    lv_delimiter type string,
    lv_cnt TYPE sytabix,
    *-Cursor Declaration
    lv_Y03HOCSINH_dbcur TYPE cursor,
    lv_tabix_frm TYPE sy-tabix.
    lv_delimiter = iv_delimiter.
    IF iv_hashvalue = 'HVM'.
    *Open/delete output file
    CONCATENATE iv_path iv_filename INTO lv_path.
    *Check for file existence, if found, delete it
    OPEN DATASET lv_path FOR INPUT
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    DELETE DATASET lv_path.
    ENDIF.
    *Open/create output file
    OPEN DATASET lv_path FOR APPENDING
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    *Batch Processing
    OPEN CURSOR WITH HOLD lv_Y03HOCSINH_dbcur FOR
    SELECT HOCSINH_ID
    MA_HOC_SINH
    TEN_HOC_SINH
    GIOI_TINH
    DIA_CHI
    GHI_CHU
    FROM Y03HOCSINH.
    DO.
    *Check for the counter, only for first batch
    *process new line is required...
    lv_cnt = lv_cnt + 1.
    REFRESH tt_Y03HOCSINH.
    FETCH NEXT CURSOR lv_Y03HOCSINH_dbcur
    APPENDING TABLE tt_Y03HOCSINH
    PACKAGE SIZE IV_FETCH_BATCH_SIZE.
    IF NOT tt_Y03HOCSINH IS INITIAL.
    ELSE.
    EXIT.
    ENDIF.
    LOOP AT tt_Y03HOCSINH INTO wa_Y03HOCSINH.
    MOVE wa_Y03HOCSINH-HOCSINH_ID
    TO wa_final_tmp-Y03HOCSINH_HOCSINH_ID.
    MOVE wa_Y03HOCSINH-MA_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_Y03HOCSINH-TEN_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_Y03HOCSINH-GIOI_TINH
    TO wa_final_tmp-Y03HOCSINH_GIOI_TINH.
    MOVE wa_Y03HOCSINH-DIA_CHI
    TO wa_final_tmp-Y03HOCSINH_DIA_CHI.
    MOVE wa_Y03HOCSINH-GHI_CHU
    TO wa_final_tmp-Y03HOCSINH_GHI_CHU.
    APPEND wa_final_tmp TO tt_final_tmp.
    ENDLOOP.
    free : tt_Y03HOCSINH.
    LOOP AT tt_final_tmp INTO wa_final_tmp.
    MOVE wa_final_tmp-Y03HOCSINH_HOCSINH_ID
    TO wa_final_target-C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_tmp-Y03HOCSINH_MA_HOC_SINH
    TO wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH
    TO wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_GIOI_TINH
    TO wa_final_target-C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_tmp-Y03HOCSINH_DIA_CHI
    TO wa_final_target-C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_tmp-Y03HOCSINH_GHI_CHU
    TO wa_final_target-C5_Y03HOCSINH_GHI_CHU.
    Append wa_final_target to tt_final_target.
    ENDLOOP.
    free : tt_final_tmp.
    Clear wa_final_target.
    IF NOT iv_max_row_cnt IS INITIAL.
    Loop at tt_final_target into
    wa_final_target TO iv_max_row_cnt.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ELSE.
    Loop at tt_final_target into wa_final_target.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ENDIF.
    free : tt_final_target.
    IF NOT gt_result IS INITIAL.
    CLEAR wa_result.
    LOOP AT gt_result INTO wa_result.
    TRANSFER wa_result TO lv_path.
    ENDLOOP.
    ENDIF.
    REFRESH gt_result.
    *End of main loop for batching
    ENDDO.
    *Close dataset
    CLOSE DATASET lv_path.
    CLOSE CURSOR lv_Y03HOCSINH_dbcur.
    ELSE.
    DATA: lv_mesg TYPE string.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    CONCATENATE
    'Error occurred when creating dataset' lv_path
    INTO lv_mesg.
    et_file_return-message = lv_mesg.
    Append et_file_return.
    ENDIF.
    ELSE.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    et_file_return-message =
    'Installed ABAP program does not match interface definition'.
    APPEND et_file_return.
    ENDIF.
    Thanks for help

    r u able to figure it out..........i got the same error .......can someone help me fix this issue

  • Code to call url in abap program

    code to call url in abap program using cl_http requests and save the outcome to a location  in a file

    See the below program
    REPORT zbrowser .
    TABLES : sscrfields.
    INCLUDE .
    CONSTANTS: htmlcntl_eventid_on_navigate TYPE i VALUE 1.
    CONSTANTS: htmlcntl_eventid_navigate_com TYPE i VALUE 2.
    DATA : h_html_ctrl TYPE cntl_handle,
    repid TYPE sy-repid,
    dynnr TYPE sy-dynnr,
    cmd TYPE sy-ucomm,
    flag,disp.
    DATA : it_exclude LIKE TABLE OF rsexfcode WITH HEADER LINE.
    SELECTION-SCREEN : FUNCTION KEY 1,
    FUNCTION KEY 2,
    FUNCTION KEY 3,
    FUNCTION KEY 4,
    FUNCTION KEY 5.
    General Browser to View
    Files/Pictures & WebPages
    © 2005 SAP AG 2
    SELECTION-SCREEN COMMENT 45(50) comment1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(28) comment2 FOR FIELD url.
    SELECTION-SCREEN POSITION 31.
    PARAMETERS : url(1064) LOWER CASE .
    SELECTION-SCREEN PUSHBUTTON 79(4) open USER-COMMAND open.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
    comment1 = 'ABAP INTERNET EXPLORER'.
    comment2 = 'Enter URL/Filename To Open :'.
    open = icon_transfer .
    sscrfields-functxt_05 = icon_sap.
    sscrfields-functxt_04 = icon_booking_stop.
    sscrfields-functxt_03 = icon_refresh.
    sscrfields-functxt_02 = icon_arrow_right.
    sscrfields-functxt_01 = icon_arrow_left.
    repid = sy-repid.
    dynnr = '1000'.
    it_exclude-fcode = 'ONLI'.
    APPEND it_exclude.
    it_exclude-fcode = 'INFO'.
    APPEND it_exclude.
    *Changing GUI status
    CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
    p_status = sy-pfkey
    p_program = repid
    TABLES
    p_exclude = it_exclude.
    CALL FUNCTION 'CONTROL_INIT' .
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    CALL FUNCTION 'HTMLCNTL_CREATE'
    EXPORTING
    owner_repid = repid
    link_repid = repid
    dynnr = dynnr
    handle = h_html_ctrl
    EXCEPTIONS
    control_install_error = 1
    create_error = 2
    General Browser to View
    Files/Pictures & WebPages
    © 2005 SAP AG 3
    OTHERS = 3
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    CALL FUNCTION 'HTMLCNTL_INIT'
    EXPORTING
    h_control = h_html_ctrl
    left = 1
    top = 2
    width = 143
    height = 37
    register_event_on_navigate = 'X'
    cb_form_navigate_complete = 'ON_CONTROL_EVENT'
    EXCEPTIONS
    cntl_system_error = 1
    cntl_error = 2
    dp_create_error = 3
    dp_install_error = 4
    dp_error = 5
    create_browser_error = 6
    init_error = 7
    OTHERS = 8
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    CALL FUNCTION 'CONTROL_FLUSH'.
    AT SELECTION-SCREEN.
    cmd = sscrfields-ucomm.
    CASE cmd.
    WHEN 'OPEN'.
    PERFORM load_html_page.
    CALL FUNCTION 'CONTROL_FLUSH'.
    WHEN 'FC01'. "BACK
    CALL FUNCTION 'HTMLCNTL_GO_BACK'
    EXPORTING
    h_control = h_html_ctrl.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    General Browser to View
    Files/Pictures & WebPages
    © 2005 SAP AG 4
    PERFORM get_current_url.
    WHEN 'FC02'. "FORWARD
    CALL FUNCTION 'HTMLCNTL_GO_FORWARD'
    EXPORTING
    h_control = h_html_ctrl.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    PERFORM get_current_url.
    WHEN 'FC03'. "REFRESH
    CALL FUNCTION 'HTMLCNTL_DO_REFRESH'
    EXPORTING
    h_control = h_html_ctrl.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    PERFORM get_current_url.
    WHEN 'FC04'. "STOP
    CALL FUNCTION 'HTMLCNTL_STOP'
    EXPORTING
    h_control = h_html_ctrl.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    WHEN 'FC05'. "GO TO HOME
    CALL FUNCTION 'HTMLCNTL_GO_HOME'
    EXPORTING
    h_control = h_html_ctrl.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    PERFORM get_current_url.
    CALL FUNCTION 'CONTROL_FLUSH'.
    WHEN OTHERS.
    General Browser to View
    Files/Pictures & WebPages
    © 2005 SAP AG 5
    CALL FUNCTION 'CONTROL_DISPATCH'
    EXPORTING
    fcode = cmd.
    CALL FUNCTION 'CONTROL_FLUSH'.
    ENDCASE.
    CLEAR cmd.
    CALL FUNCTION 'CONTROL_FLUSH'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR url.
    PERFORM get_file_name.
    PERFORM load_html_page.
    *& Form get_page_name
    Get Page Name
    FORM get_file_name.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    DEF_FILENAME = ' '
    def_path = 'C: '
    mask = ',.,..'
    mode = 'o'
    title = 'Browse to Open'
    IMPORTING
    filename = url
    RC =
    EXCEPTIONS
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    ENDFORM. " get_page_name
    *& Form load_html_page
    TO load the file (URL)
    General Browser to View
    Files/Pictures & WebPages
    © 2005 SAP AG 6
    FORM load_html_page.
    CALL FUNCTION 'HTMLCNTL_SHOW_URL'
    EXPORTING
    h_control = h_html_ctrl
    url = url.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    flag = 'X'.
    ENDFORM. " load_html_page
    *& Form get_current_url
    Get Current URL
    FORM get_current_url.
    CALL FUNCTION 'HTMLCNTL_GET_CURRENT_URL'
    EXPORTING
    h_control = h_html_ctrl
    IMPORTING
    url = url.
    ENDFORM. " get_current_url
    Callback form for the event 'NavigateComplete'
    callback on_control_event.
    CALL FUNCTION 'CONTROL_GET_EVENT_PARAM'
    EXPORTING
    h_control = h_html_ctrl
    param_id = 0
    CHANGING
    return = url.
    PERFORM get_current_url.
    endcallback.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Execute ABAP Program - Error in Open File Cust_Dim.dat

    HI All,
    I am trying to Implement scenario of Data Service designer for Extract SAP Application data (page no. 181 Onwards). It is for transfer data from SAP ECC - KNA1 to MSSQL table.
    I have Data Service server install on my system.
    I have implement all the steps. When I execute job server. I am getting error like
    "Execute ABAP program <C:/Program Files/Business Objects/BusinessObjects Data Services/ZCUSTDIM_1.aba> error < Open File Error -- C:\Program Files\Business Objects\/Cust_Dim.dat>"
    Does anyone knows about this? I have tried to find lot in SDN but didn't find any solution.
    Thanks
    Ratnakar

    Hi all
    I was having the exact same problem as the one explained here.
    I was a little mixed up because I assigned full privileges on the destination folder to one specific account called installsap
    I used  this account for installing SAP BO Data Services. This account is the one configured on the Business Objects Data Services Service:
    However, I kept getting the same error, as if this account had not enough privileges over the folder.
    I saw that there is another Service called Server Intelligent Agent. I went through its configuration Properties by using the Central Configuration Manager, specifically within the Log On As Property and it seemed like a non specific System Account was configured there.
    Then I open the services.msc (Windows application) in order to see this very same service configuration and it had NOTHING specified there, nor a Local System Account nor an specific user account.
    So, I stopped the service and specified the installsap account I used for the Business Objects Data Services Service. After that I verified I could see this configuration through the Central Configuration Manager and now both tools showed the same.
    Then I started the SIA Service retried again executing the ABAP Data Flow and the Error in Open File was gone.
    It is how the SIA Service configuration looks like.
    By the way, I am not sure if the "Job Server Service" which was cited before in this thread is the same as the Server Intelligence Agent Service I modified
    Besides, although I've been using DS for quite a considerable amount of time, I have never heard of such "Job Server Service". Let me know if I am wrong.
    Anyways it worked for me and I hope it works for someone else who faces the same error.
    Best regards!

  • CALLING BAPI in ABAP program

    Hi,
    I want to call BAPI_MATERIAL_AVAILABILITY in ABAP program. Please give me some sample code how i can do this??? Please help

    hi,
    REPORT  YATP.
    DATA: LV_TABIX  LIKE SY-TABIX,
            LT_WMDVSX LIKE BAPIWMDVS OCCURS 0 WITH HEADER LINE,
            LT_WMDVEX LIKE BAPIWMDVE OCCURS 0 WITH HEADER LINE.
    data ET_PROCUREMENT_ITEM LIKE BBPPOGN.
      LV_TABIX = SY-TABIX.
      CLEAR: LT_WMDVSX, LT_WMDVEX.
      REFRESH: LT_WMDVSX, LT_WMDVEX.
    Fill communication table
      LT_WMDVSX-REQ_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
      LT_WMDVSX-REQ_QTY  = ET_PROCUREMENT_ITEM-QUANTITY.
      APPEND LT_WMDVSX.
    Availability check with check rule '03'
      CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
           EXPORTING
                PLANT      = 'ALB1'
                MATERIAL   = '100000223'
                UNIT       = 'EA'
                CHECK_RULE = '03'
           TABLES
                WMDVSX     = LT_WMDVSX
                WMDVEX     = LT_WMDVEX
           EXCEPTIONS
                OTHERS     = 1.
      IF SY-SUBRC EQ 0.
        READ TABLE LT_WMDVEX WITH KEY
                             COM_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
        IF SY-SUBRC EQ 0.
          ET_PROCUREMENT_ITEM-AVAIL_QTY = LT_WMDVEX-COM_QTY.
        ENDIF.
      ENDIF.
      write :/ et_procurement_item-avail_qty.
      Loop at lt_wmdvex.
      write : / lt_wmdvex-COM_QTY,
              lt_wmdvex-BDCNT,
               lt_wmdvex-REQ_QTY.
    endloop.
    This is my program  but no value written  for WMDVEX.

  • Is it possible to call website from ABAP Program?

    Hi Experts,
           Is it possible to call website from ABAP Program?
    It is very Urgent Help me.
    Regards,
    Ashok.

    Hi,
    Check the following program:
    REPORT ZURL NO STANDARD PAGE HEADING.
    DATA: BEGIN OF URL_TABLE OCCURS 10,
    L(25),
    END OF URL_TABLE.
    URL_TABLE-L = 'http://www.lycos.com'.APPEND URL_TABLE.
    URL_TABLE-L = 'http://www.hotbot.com'.APPEND URL_TABLE.
    URL_TABLE-L = 'http://www.sap.com'.APPEND URL_TABLE.
    LOOP AT URL_TABLE.
      SKIP. FORMAT INTENSIFIED OFF.
      WRITE: / 'Single click on '.
      FORMAT HOTSPOT ON.FORMAT INTENSIFIED ON.
      WRITE: URL_TABLE. HIDE URL_TABLE.
      FORMAT HOTSPOT OFF.FORMAT INTENSIFIED OFF.
      WRITE: 'to go to', URL_TABLE.
    ENDLOOP.
    CLEAR URL_TABLE.
    AT LINE-SELECTION.
    IF NOT URL_TABLE IS INITIAL.
      CALL FUNCTION 'WS_EXECUTE'
           EXPORTING
                program = 'C:\Program Files\Internet Explorer\IEXPLORE.EXE'
                commandline     = URL_TABLE
                INFORM         = ''
              EXCEPTIONS
                PROG_NOT_FOUND = 1.
      IF SY-SUBRC <> 0.
         WRITE:/ 'Cannot find program to open Internet'.
      ENDIF.
    ENDIF.
    Regards,
    Bhaskar

  • How to set a  Executable ABAP  Program to run as a Background Batch Job

    Hi
    Currently  I had a Executable ABAP  Program which when executed prompts for user to enter selection once entered and executed it will delete user entered selections from a Table.
    Now my requirment is to enhance that program to run it as a BACKGROUND BATCH JOB so that there will be an entry in SM37 when the program is executed
    How can i achieve this

    Hi,
    Please refer this link .
    It has the steps.
    http://sapient.wordpress.com/2007/06/19/how-do-you-set-up-background-jobs-in-sap/
    Regards,
    SuryaD.

  • Problem with the active version of the transfer rule ABAP program with sour

    Hi,
    I have a problem with the active version of the transfer rule ABAP program with source system EXCEL. 
    The system does not react to changes done in the transfer rule coding. For FISCPER I have hardcoded the result 'BABABA' and still the results delivered are those from the CSV.
    Resetting the system buffers does not help. The problem is systematic in combination with source system EXCEL (i.e. not only 1 InfoSource).  Checking the active program Extras->Display Program shows the coding (result='BABABA') being there, but
    as stated, the system does not produce the result BABABA, but instead the result of the CSV.
    It seems as if the original version from the very first activation of the transfer rule program remains somewhere and continues to be used.  Does anybody know how to flush it out and get the system to actually use the coding appearing as the active program.
    I have posted an OSS note, but SAP takes it time to answer and I am under time pressure so I figured that maybe one of you know who to solve it before SAP does.
    Greetings and thanks,
    Martin

    Hi martin,
    just try to go out the RSA1 and then return to your infopac. ...
    sometimes there some "cache" trouble

  • Calling Actions in ABAP Programming.

    Hi,
    Is it possible to call ACTIONS in ABAP programming?
    Regards,

    Hi Pushpa,
    The receiver type is the workflow you want to start, when the event occurs, of corresponding object type.
    I Never had the need to develop at workflow level, but search a little in the foruns and you'll find a lot of info about this. I also advice you to open new threads when asking new questions: It's more appropriate and will bring you more answers
    Kind regards,
    Garcia

  • Execute report RMMVRZ00 with variants

    Hi Experts,
    Could someone explain how to execute report RMMVRZ00 with variants.
    Report RMMVRZ00 is similar to transaction MM60.
    I am checking how to execute this report with variants.
    Thank you

    The following link would help in creating variants
    [Creating Report Variants|http://help.sap.com/saphelp_45b/helpdata/en/73/69ee7d55bb11d189680000e829fbbd/content.htm]
    If you have any specific requirement with variant, please post again

  • How to create a job thru ABAP program for calling a program with variant???

    Hello experts,
    can u give me step wise procedure to create jobs for  a program with a variant name thru ABAP???
    Also, can a transaction can be scheduled as a job to run in background with a variant name???
    Edited by: SAP USER on Jul 22, 2008 6:08 AM

    Hi,
    To create a job through ABAP program you can do the following.
    Go to Menu bar.
    In there, go to   SYTSTEM> SERVICES> JOBS--> DEFINE JOB.
    Then give the JOB NAME and CLASS in the screen that comes up.
    This is how we schedule a program.
    Now, to create a variant for a program -
    First activate your program in SE38. Then execute it .
    Now, click on SAVE button. It will open up  the variant creation screen. Give the details there like variant name and value for the fields. Save and come back.
    Hope this helps.
    Regards,
    Hari Kiran

  • How use a proxy consumer web service in ABAP Program with local interface

    I generate a proxy class based on a WSDL file.
    I want to use this class in an abap programm without a connection but using XML files in local.
    I see with the class CL_PROXY_LOCAL_ADAPTER that it is possible to execute without connection but for use this, it's necessary to use the method REGISTER.
    This method have two parameters : Class Name and Interface Name.
    Class name is the name of my proxy class, but I don't know how to find the interface name.
    I think that a local interface is needed to generate but I don't know how to generate in interface with entries in SPROXSIG table ?
    Could you help me ?

    Check out the following links to see if it meets your needs.. Has examples to call a ABAP proxy (that consumes a webservice) from ABAP program...
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm (webservices ->webservices toolset -> examples)
    http://help.sap.com/saphelp_dm40/helpdata/en/1a/b69d427cab0831e10000000a1550b0/frameset.htm

Maybe you are looking for

  • Sorry, a serious error has occured

    I worked on a project for several hours yesterday. Now it will not open. I tried opening another project from last week. WILL NOT OPEN. In fact, none of my Premiere CC projects will open. They are all corrupt. Well done Adobe. I'm missing Final Cut P

  • Select and update leave request data - oracle !!

    Dears, We have a very important presentation here to one of our stakeholders and he is interested to see how to submit and update leave requests using Adobe LiveCycle Workspace. I have a simple PDF form where the user can choose to submit new leave o

  • Problem creating operation assignment in ESR Model

    I am trying to follow the step-by-step instruction from Franklin Herbas's blog - https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8018. [original link is broken] [original link is broken] [original link is broken]  It worked fine initially but I

  • Invalid Sender in UWL

    Hi, I am facing critical problem in Universal Worklist. I have developed a Leave approval Workflow for our client. In this scenario, 1. Manager will create a Sick Leave on behalf of Employee in the portal. 2. Employee will look into that and change a

  • Trying to open the iTunes installer but nothing appears.

    Hello People. I've just downloaded the iTunes latest version (I have never tried to install any version of iTunes before) and basically the installer doesn't open. I try to execute the installer file and nothing appears, even an error message or some