Function module to read bkpf table

Hello everybody ,
i want to  read BKPF table but their is  lot's of record in table  BKPF  .
i used select query   , now report is taking time  .
i want to reduce performance time .
is their  anyway to  read BKPF  table so that  report will take less time   ?
or is their any function module  available ?

Hi,
There are function modules (FAGL_GET_BKPF) to read values from BKPF.. but they can read single values at a time....
According to me Make the SELECT statement with conditions to match all the key fields of BKPF table (BUKRS, BELNR, GJAHR.)
And maintain the order of fields according to database. this will greatly reduce time...
and also do not use INTO CORRESPONDING FIELDS OF..

Similar Messages

  • Function Module to read EDIDC table data.

    Dear All,
    I am retrieving data from EDIDC table depending upon the creation date and message type. But it is consuming a lot time and hence while going for more than one month data , it gives run time error.
      I found while going through debugger that maximum time is consumed  by the SELECT query in retrieving the EDIDC data.
    Is there any Function Module for retrieving EDIDC table data.
    If so kindly let me know.

    How can a fm replace this performance issue ? You have only two fields to be passed such as creation date and message type.
    For the table EDIDC there is a secondary index 3 for message type. Did you use that ? What is your query written ?
    If you look into the standard report RSEIDOC2, the field for creation date used is UPDDAT. It implies usage of secondary index 2
    Refer line no 114
    Regards
    Kesav

  • Any function module to read all the values in Tcode-PPQD?

    Hi all
    Is there any function module to read all the values in Tcode-PPQD (Display Qualifiaction Catalog).
    and any idea what tables are involved to get these values like parent and child relationship?
    Thanks in advance.
    Murali.

    Murali,
    you can use the following..
    data: w_sobid type sobid, "Qualification ID
          w_objid type objid. "Qualification Catalog
    select objid  into w_objid
                  up to 1 rows
                  from HRP1001
                 where otype = 'QK'
                   and plvar = '01'
                   and istat = 1
                   and risgn = 'B'
                   and relat = '030'
                   and endda ge sy-datum
                   and begda le sy-datum
                   and sclas = 'Q'
                   and sobid = w_sobid.
    endselect.
    if sy-subrc eq 0.
    write: / w_objid,w_sobid.
    endif.
    Regards,
    Suresh Datti

  • Function module to read 'Customer Material InfoRecords'?

    Is there a function module to read customer material inforecords?
    Transaction code VD53 is the display screen for Customer Material INforecords. I have a requirement to read this data in user exit.
    Thanks
    Gova

    I found one FM. RV_CUSTOMER_MATERIAL_READ
    But it won't serve my purpose as I need to find customer material number for a given material number.
    But, I found the table where this information is stored. KNMT. I'm going to create a custom FM to serve my purpose.

  • Help required in creating function module which reads payroll clusters.

    Hi ,
    We have a requirement where in we need to create a function module for reading a sequence of tables from payroll clusters. This function module does two functions:
    1.Read the payroll results from one system.
    2.write the payroll results to other system.
    please do the needful as soon as possible.
    Thanks in advance.
    Regards,
    Durga.

    hi
    Refer to the below thread
    Programming with Clusters for HR-Payroll
    Regards
    Sameer

  • Function module to read Comma Seperated File (CSV)

    Hi,
    Is there any Function module to read CSV file from presentation server or Application server?
    Regards,
    Madhu

    Hi madhukeshwar,
    1. Exactly for this purpose,
    i have developed an independent FORM
    where we give inputs
    a) file name (eg. abcd.txt)
    b) separator (eg , COMMA in your case)
    c) internal table (eg. t001)
    2. It will provide the data
    in proper format
    (no matter what the separator)
    (it can work with any kind of separator)
    3. just copy paste in new program.
    REPORT abc.
    change your table declaration and file name
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    PERFORM myupload TABLES t001 USING 'd:\t001.txt' ','.
    BREAK-POINT.
    in debug see t001
    INDEPENDENT FORM
    FORM myupload TABLES orgtab
    USING filename separator.
    Data
    DATA : BEGIN OF itab OCCURS 0,
    myline(1000) TYPE c,
    END OF itab.
    DATA : extension(5) TYPE c.
    DATA : name(100) TYPE c.
    DATA : newfilename TYPE string.
    Step 1
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = filename
    TABLES
    data_tab = itab.
    Step 2
    LOOP AT itab.
    REPLACE ALL OCCURRENCES OF separator IN itab-myline WITH
    cl_abap_char_utilities=>horizontal_tab.
    MODIFY itab.
    ENDLOOP.
    Step 3
    DATA : path LIKE pcfile-path.
    path = filename.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    CHECK_DOS_FORMAT =
    IMPORTING
    DRIVE =
    extension = extension
    name = name
    NAME_WITH_EXT =
    PATH =
    EXCEPTIONS
    invalid_drive = 1
    invalid_extension = 2
    invalid_name = 3
    invalid_path = 4
    OTHERS = 5
    Step 4
    newfilename = filename.
    REPLACE name IN newfilename WITH 'temp'.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    filename = newfilename
    TABLES
    data_tab = itab
    FIELDNAMES =
    Step 5
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = newfilename
    has_field_separator = 'X'
    TABLES
    data_tab = orgtab.
    ENDFORM. "myupload
    3.
    regards,
    amit m.

  • Function module for reading payroll results

    HI,
    I need a function module for reading payroll results RT table.
    Import parameters are personal number, payroll area, and payroll period.
    Export should be RT table.
    Regards,
    Wasim Ahmed

    Hai Wasim
    Check the following Code
    data: payroll_cluster like t500l-relid.
        call function 'PYXX_READ_PAYROLL_RESULT'
             exporting
                  clusterid                    = payroll_cluster
                  employeenumber               = pernr-pernr
                  sequencenumber               = payroll-evp-seqnr
                READ_ONLY_BUFFER             = ' '
                READ_ONLY_INTERNATIONAL      = ' '
                CHECK_READ_AUTHORITY         = 'X'
           IMPORTING
                VERSION_NUMBER_PAYVN         =
                VERSION_NUMBER_PCL2          =
             changing
                  payroll_result               = payroll_us
            exceptions
                 illegal_isocode_or_clusterid = 1
                 error_generating_import      = 2
                 import_mismatch_error        = 3
                 subpool_dir_full             = 4
                 no_read_authority            = 5
                 no_record_found              = 6
                 versions_do_not_match        = 7
                 others                       = 8
        if sy-subrc <> 0.
          if sy-subrc <> 0.
            write: / 'Fehler beim Laden des US Abrechnungsergebnisses'(003).
            write: /'zu Personalnummer'(008), pernr-pernr,
                    'bei Sequence-Number'(012),
                     payroll-evp-seqnr.
            write: /  'Fehlercode ='(004), sy-subrc.
          endif.
        endif.
    Thanks & regards
    Sreenivasulu P

  • Function module for reading service line items of a po

    function module for reading service line items of a po.............I want to read data from eslh and esll tables to getthe service line details.....
    My requirement is if the item category is 9 I need to print the service line items. So I wan to read the data of service line items from a function module. I am not able to find a fm which fetches both elsh and esll data...

    Hi oskchaitanya ,
    use bapi BAPI_PO_GETDETAIL1.
    Regards
    REA

  • Function Module: how to setting table import parameter

    hi, i'm developing a function module. i create a TABLES where it will allow multiple variables  IMPORT from user input to this function module. the tables i set as OPTIONAL and decribed as below.
    PSPID     PS_PSPID     CHAR     24
    POSID     PS_POSID     CHAR     24
    AUFNR     AUFNR     CHAR     12
    PSY     J_STATUS     CHAR     5
    PUS     J_STATUS     CHAR     5
    in my source code, i done a select statement to process the IMPORT input . the problems i face,for the PSY and PUS  input,  if the one or both input is BLANK, NO RESULT will display. What i'm try to do , if input one or both  is BLANK, it wil neglect the input and return as ALL RESULT (return result oir all status for input pspis / posid / aufnr)  . attached the select statement. thank you
    itparm[] = objparm[].
    select
        a~pspnr a~stspr a~objnr a~pspid
        b~psphi b~objnr as wobjnr b~posid
        c~aufnr c~objnr as nobjnr c~pspel
        d~objnr as jeobjnr d~inact d~stat
        e~objnr as jcobjnr e~udate e~usnam e~utime e~stat as jcstat e~inact as jcinact
        f~istat as syistat
        f~txt04 as sytxt04
        f~spras
        g~estat as usestat
        g~txt04 as ustxt04
        into corresponding fields of table itobj
        from proj as a
        inner join prps as b on a~pspnr = b~psphi
        inner join aufk as c on b~pspnr = c~pspel
        inner join jest as d on c~objnr = d~objnr
        inner join jcds as e on d~objnr = e~objnr
                             and d~stat = e~stat
        inner join tj02t as f on e~stat = f~istat
        inner join tj30t as g on a~stspr = g~stsma
        for all entries in itparm
        where ( a~pspid = itparm-pspid
        or b~posid = itparm-posid
        or c~aufnr = itparm-aufnr )
       and ( f~istat = itparm-PSY and g~estat = itparm-PUS ).

    Thanks for your quick reply. actually the data will be somehing like this. since i developed a function module, i keep the import parameter in a table.
    PSPID     PS_PSPID     CHAR     24
    POSID     PS_POSID     CHAR     24
    AUFNR     AUFNR         CHAR     12
    PSY       J_STATUS     CHAR     5
    PUS      J_STATUS     CHAR     5
    the example data will be in OTPARM internal table
    PSPID              POSID          AUFNR     PSY     PUS
    aa-aa-aa         a1                                  I001
    bb-bb-bb                              b1                        E009
    cc-cc-cc
    i'll store  this into an internal table. from the data. it can be seen there a BLANK input. so the blank input should not be included into WHERE connditions. that why in the previous solution, i use SELECT inside LOOP because every line of the IMPORT tables will be generated with different WHERE conditions. i tried to do something like this:
    PSPID         POSID     AUFNR     PSY     PUS        cond_syx
    aa-aa-aa     a1                           I001                  if proj~pspid = itparm-pspid and prps~posid = itparm~posid and ....
    bb-bb-bb                   b1                         E009     if proj~pspid = itparm-pspid and aufk~aufnr = itparm~paufnr and ....
    cc-cc-cc                                                             if proj~pspid = itparm-pspid
    and implement with FOR ALL ENTERIES, but at the WHERE conditions i failed to put the CONF_SYX. please comment and give opinions. Thanks you very much.

  • Function Modul for read field label

    hi all
    i search a function modul for read the field label from data element.
    Example for data element matnr, i must have field label text material.
    Thx abap_begin

    Hi,
    If you give input parameters type, field and table you get data element using
    RP_PRINT_GET_DATA_ELEMENT
    Try also
    KL_TABLE_INFO_GET
    But not sure if this futfill your requirement...

  • Function Module to Read data from ESLH & ESLL

    Hi All,
    Presently i am working on the Service Purchase Order
    I have to get the data from the Service Master tax conditions which is storing in ESLH & ESLL database tables.
    So is there any Function Module to get the data.
    regards:
    Sridhar J

    Hi David,
    The normal procedure is using Function Module RSDRI_INFOPROV_READ. However, according to the documentation it only works for DSOs, InfoCubes and MultiProviders.
    Could you access as a work-around a MultiProvider? Or use any logic to first determine which PartProvider of the SPO-based DSO or InfoCube is required and then use the Function Module to read the data?
    Best regards,
    Sander

  • Function module to read error message provided message class and mssg no.

    Hi experts,
    I am trying to populate my database table with the error message.
    The error message as comming form standard code in an ITAB.
    I am getting the error class and message number.
    Can any body please tell me any function module to read the error.
    Or is there any way to populate the database table with the error message.
    Regards,
    Sandipan.

    Hi,
        You can use the Function module mentioned below.
    call transaction 'VA42' using bdcdata  mode  w_mode
                                        update  w_synch
                                      messages into it_mesgtab.
        loop at it_mesgtab into wa_mesgtab where msgtyp ca 'EA'.
        endloop.
        if sy-subrc <> 0.
          read table it_mesgtab into wa_mesgtab index 1.
        endif.
        call function 'MESSAGE_TEXT_BUILD'
          exporting
            msgid               = wa_mesgtab-msgid          "Messg class
            msgnr               = wa_mesgtab-msgnr          "Messg No.
            msgv1               = wa_mesgtab-msgv1
            msgv2               = wa_mesgtab-msgv2
            msgv3               = wa_mesgtab-msgv3
            msgv4               = wa_mesgtab-msgv4
          importing
            message_text_output = it_err-sapmessage.
       Append it_err.
    Regards,
         Srinivas

  • Function module to read Lock objects

    Hi all,
    I'm doing a generic search program for all the objects..
    Is there any function module to read Lock objects....
    that is to know wat r all the tables and Lock parameters are there in a lock object

    Hi Gayathri
    Please read the table DD25L with AGGTYPE = 'E' to get all the lock object names in the field VIEWNAME. Use these lock object to read the table DD27S to get the fields present in these lock objects.
    Hope this helps !
    Regards
    Ranganath
    PS : Reward points for all useful answers !

  • Function module to read the the idoc

    Hi abap gurus,
       I have an inbound idoc coming form a wms system .The IDOC is for goods recieved . how can I read the idoc to update the inbound delivery data in the sap system ? Is there any function module to read the data from teh inbound idoc ?

    Hi Gaurab,
    Creating a Function Module (Direct Inbound Processing)
    This step describes how to create a function module which is identified by the IDoc Interface using a new process code and called from ALE (field TBD52-FUNCNAME). Direct inbound processing using a function module (not using a workflow) always includes the ALE layer. This setting (processing with function module and ALE layer) is identified by the value 6 in the field TEDE2-EDIVRS, which is read by the function module IDOC_START_INBOUND. IDOC_START_INBOUND then calls ALE.
    Prerequisites
    You must have completed the required steps in Defining and Using a Basic Type .
    Procedure
    Choose Tools ® ABAP Workbench ® Development ® Function Builder, and create a new function module.
    Create the segments as global data in your function group. The function module should copy the application data from the segments into the corresponding application tables and modify the IDoc status accordingly. If an error occurs, the function module must set the corresponding workflow parameters for exception handling.
    Activate the function module: From the initial screen of the Function Builder select .
    In the example, create the function module IDOC_INPUT_TESTER with a global interface. The function module is called when an IDoc of type TESTER01 is received for inbound processing. You will assign an application object ("standard order") to this IDoc type and therefore maintain tables from SD. To do this, call transaction VA01 using the command CALL TRANSACTION. Please note that the intention here is not to simulate a realistic standard order, but only to illustrate how data reaches application tables from an IDoc table via segment structures (form routine READ_IDOC_TESTER) and how the function module triggers an event for exception handling (by returning suitable return variables to the ALE layer in the FORM routine RETURN_VARIABLES_FILL).
    A comprehensive example of the code for an inbound function module is provided in the ALE documentation in the SAP Library under  Example Program to Generate an IDoc. This function module, for example, also checks whether the logical message is correct and calls a (fictitious) second function module which first writes the application data and then returns the number of the generated document. In addition, status 53 is only set if the application document was posted correctly.
    Administration parameters for IDOC_INPUT_TESTER
    Application abbreviation
    V (Sales and Distribution)
    Processing type
    Normal, start immediately
    Interface for IDOC_INPUT_TESTER (global interface)
    Formal parameters
    Reference structure
    Explanation
    Import parameters
    INPUT_METHOD
    BDWFAP_PAR-INPUTMETHD
    Describes how the function module is to be processed (example: in the background)
    MASS_PROCESSING
    BDWFAP_PAR-MASS_PROC
    Mass inbound processing? (indicator)
    Export parameters
    WORKFLOW_RESULT
    BDWFAP_PAR-RESULT
    Set to 99999 if an event is to be triggered for error handling.
    APPLICATION_VARIABLE
    BDWFAP_PAR-APPL_VAR
    Variable freely available from application for workflow
    IN_UPDATE_TASK
    BDWFAP_PAR-UPDATETASK
    Asynchronous update? (indicator is not set in example)
    CALL_TRANSACTION_DONE
    BDWFAP_PAR-CALLTRANS
    Transaction called? (indicator is not set in example)
    Table
    IDOC_CONTRL
    EDIDC
    IDoc control record
    IDOC_DATA
    EDIDD
    IDoc data records
    IDOC_STATUS
    BDIDOCSTAT
    IDoc status records for ALE
    RETURN_VARIABLES
    BDWFRETVAR
    IDoc assigned to Object type method parameters.
    SERIALIZATION_INFO
    BDI_SER
    If several IDocs are to be processed in a certain sequence: this structure contains the necessary information
    Example
    FUNCTION IDOC_INPUT_TESTER.
    ""Globale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(INPUT_METHOD) LIKE  BDWFAP_PAR-INPUTMETHD
    *"             VALUE(MASS_PROCESSING) LIKE  BDWFAP_PAR-MASS_PROC
    *"       EXPORTING
    *"             VALUE(WORKFLOW_RESULT) LIKE  BDWFAP_PAR-RESULT
    *"             VALUE(APPLICATION_VARIABLE) LIKE  BDWFAP_PAR-APPL_VAR
    *"             VALUE(IN_UPDATE_TASK) LIKE  BDWFAP_PAR-UPDATETASK
    *"             VALUE(CALL_TRANSACTION_DONE) LIKE  BDWFAP_PAR-CALLTRANS
    *"       TABLES
    *"              IDOC_CONTRL STRUCTURE  EDIDC OPTIONAL
    *"              IDOC_DATA STRUCTURE  EDIDD
    *"              IDOC_STATUS STRUCTURE  BDIDOCSTAT
    *"              RETURN_VARIABLES STRUCTURE  BDWFRETVAR
    *"              SERIALIZATION_INFO STRUCTURE  BDI_SER
    initialize SET/GET Parameter and internal tables
      PERFORM INITIALIZE_ORGANIZATIONAL_DATA.
    Move IDOC to internal tables of application
      PERFORM READ_IDOC_TESTER.
    call transaction Order Entry VA01
      PERFORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
    set status value
      perform write_status_record using errorcode.
    return values of function module
      PERFORM RETURN_VARIABLES_FILL USING ERRORCODE.
    ENDFUNCTION.
    FORM INITIALIZE_ORGANIZATIONAL_DATA.
    initialize SET/GET parameters
       SET PARAMETER ID 'VKO' FIELD SPACE.
       SET PARAMETER ID 'VTW' FIELD SPACE.
       SET PARAMETER ID 'SPA' FIELD SPACE.
       SET PARAMETER ID 'VKB' FIELD SPACE.
       SET PARAMETER ID 'VKG' FIELD SPACE.
    initialize internal tables
       REFRESH BDCDATA.
       CLEAR BDCDATA.
       CLEAR BELEGNUMMER.
       CLEAR ERRTAB.
       REFRESH ERRTAB.
       REFRESH XBDCMSGCOLL.
       CLEAR XBDCMSGCOLL.
    ENDFORM.                    " INITIALIZE_ORGANIZATIONAL_DATA
    FORM READ_IDOC_TESTER.
      PERFORM INITIALIZE_IDOC.
    LOOP AT IDOC_DATA
       WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
        CASE IDOC_DATA-SEGNAM.
    header data
          WHEN 'E1HEAD'.
            MOVE IDOC_DATA-SDATA TO E1HEAD.
            PERFORM PROCESS_SEGMENT_E1HEAD.
    position data
          WHEN 'E1ITEM'.
            MOVE IDOC_DATA-SDATA TO E1ITEM.
            PERFORM PROCESS_SEGMENT_E1ITEM.
        ENDCASE.
    ENDLOOP.
    only when there were one or more items
      CHECK FIRST NE 'X'.
      APPEND XVBAP.                        "last one
    ENDFORM.                    " READ_IDOC_TESTER
    FORM INITIALIZE_IDOC.
      CLEAR XVBAK.
      REFRESH XVBAP.
      CLEAR XVBAP.
      POSNR = 0.
      FIRST = 'X'.
    ENDFORM.                    " INITIALIZE_IDOC
    FORM PROCESS_SEGMENT_E1HEAD.
    requested date of delivery
      WLDAT = E1HEAD-WLDAT.
    delivery date
      XVBAK-BSTDK = E1HEAD-BSTDK.
    customer number
      XVBAK-KUNNR = E1HEAD-AUGEB.
    order number
      XVBAK-BSTNK = E1HEAD-BELNR.
    division
      XVBAK-SPART = E1HEAD-SPART.
    distribution channel
      XVBAK-VTWEG = E1HEAD-VTWEG.
    sales organization
      XVBAK-VKORG = E1HEAD-VKORG.
    order type
      XVBAK-AUART = E1HEAD-AUART.
    do not fill incoterms (inco1, inco2)
    customer function
      CALL CUSTOMER-FUNCTION '001'
           EXPORTING
                PI_VBAK621           = XVBAK
           IMPORTING
                PE_VBAK621           = XVBAK
           TABLES
                PT_IDOC_DATA_RECORDS = IDOC_DATA.
    ENDFORM.                    " PROCESS_SEGMENT_E1HEAD
    FORM PROCESS_SEGMENT_E1ITEM.
    position number
      XVBAP-POSNR = XVBAP-POSNR + 1.
    amount
      XVBAP-WMENG = E1ITEM-MENGE.
    unit
      CALL FUNCTION 'ISO_TO_SAP_MEASURE_UNIT_CODE'
           EXPORTING
                ISO_CODE  = E1ITEM-BMEINH
           IMPORTING
                SAP_CODE  = XVBAP-VRKME
           EXCEPTIONS
                OTHERS    = 0.
    material number
      XVBAP-MATNR = E1ITEM-LMATNR.
    CALL CUSTOMER-FUNCTION '002'
           EXPORTING
                PI_VBAP621           = XVBAP
           IMPORTING
                PE_VBAP621           = XVBAP
           TABLES
                PT_IDOC_DATA_RECORDS = IDOC_DATA.
    APPEND XVBAP.
    ENDFORM.                    " PROCESS_SEGMENT_E1ITEM
    FORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
    call transaction first dynpro
      PERFORM DYNPRO_START.
    call transaction double-line entry
      PERFORM DYNPRO_DETAIL2.
    incoterms
      PERFORM DYNPRO_HEAD_300.
    call transaction item datas
      PERFORM DYNPRO_POSITION.
      PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'SICH'.
    determine input method
      IF INPUT_METHOD IS INITIAL.
        INPUT_METHOD = 'N'.
      ENDIF.
    call transaction VA01
    CALL TRANSACTION 'VA01' USING    BDCDATA
                             MODE     INPUT_METHOD
                             UPDATE   'S'
                             MESSAGES INTO XBDCMSGCOLL.
    errorcode = SY-SUBRC.       " remember returncode for status update
    ENDFORM.                    " CALL_VA01_IDOC_ORDERS
    form write_status_record using errorcode.
    FILL IDOC_STATUS
    IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
    IF ERRORCODE = 0.
    IDOC_STATUS-STATUS = BELEG_GEBUCHT. "value 53
       GET PARAMETER ID 'AUN' FIELD BELEGNUMMER.
       IDOC_STATUS-MSGID = 'V1'.
       IDOC_STATUS-MSGNO = '311'.
       IDOC_STATUS-MSGV1 = 'Terminauftrag'.
       IDOC_STATUS-MSGV2 = BELEGNUMMER.
    ELSE.
        IDOC_STATUS-STATUS = BELEG_NICHT_GEBUCHT. "value 51
        IDOC_STATUS-MSGID = SY-MSwGID.
        IDOC_STATUS-MSGNO = SY-MSGNO.
        IDOC_STATUS-MSGV1 = SY-MSGV1.
        IDOC_STATUS-MSGV2 = SY-MSGV2.
        IDOC_STATUS-MSGV3 = SY-MSGV3.
        IDOC_STATUS-MSGV4 = SY-MSGV4.
      ENDIF.
      APPEND IDOC_STATUS.
    ENDFORM.
    FORM DYNPRO_START.
      PERFORM DYNPRO_NEW USING PROGRAMM_AUFTRAG
                               DYNPRO-EINSTIEG
                      CHANGING LAST_DYNPRO.
    ordertype
      PERFORM DYNPRO_SET USING 'VBAK-AUART' XVBAK-AUART.
    sales organization
      PERFORM DYNPRO_SET USING 'VBAK-VKORG' XVBAK-VKORG.
    Distribution channel
      PERFORM DYNPRO_SET USING 'VBAK-VTWEG' XVBAK-VTWEG.
    Division
      PERFORM DYNPRO_SET USING 'VBAK-SPART' XVBAK-SPART.
    Sales office
      PERFORM DYNPRO_SET USING 'VBAK-VKBUR' XVBAK-VKBUR.
    Sales group
      PERFORM DYNPRO_SET USING 'VBAK-VKGRP' XVBAK-VKGRP.
    ENDFORM.                    " DYNPRO_START
    FORM DYNPRO_NEW USING    PROGNAME
                             DYNPRONR
                    CHANGING LAST_DYNPRO.
    CLEAR BDCDATA.
    BDCDATA-PROGRAM = PROGNAME.
    BDCDATA-DYNPRO  = DYNPRONR.
    BDCDATA-DYNBEGIN   = 'X'.
    APPEND BDCDATA.
    LAST_DYNPRO = DYNPRONR.
    ENDFORM.                    " DYNPRO_NEW
    FORM DYNPRO_SET USING    FELDNAME
                             FELDINHALT.
      CLEAR BDCDATA.
      CHECK FELDINHALT NE SPACE.
    dynpro field name
      BDCDATA-FNAM = FELDNAME.
    contents
      BDCDATA-FVAL = FELDINHALT.
      APPEND  BDCDATA.
    ENDFORM.                    " DYNPRO_SET
    FORM DYNPRO_DETAIL2.
    okcode
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-UER2.
    fix dynpro number 4001
      PERFORM DYNPRO_NEW  USING    PROGRAMM_AUFTRAG
                                   '4001'
                          CHANGING LAST_DYNPRO.
    order party
      PERFORM DYNPRO_SET      USING 'KUAGV-KUNNR'  XVBAK-KUNNR.
    purchase order number
      PERFORM DYNPRO_SET      USING 'VBKD-BSTKD'   XVBAK-BSTNK.
    requested delivery date
      PERFORM DYNPRO_DATE_SET USING 'VBKD-BSTDK'   XVBAK-BSTDK.
    purchase order date
      PERFORM DYNPRO_DATE_SET USING 'RV45A-KETDAT' WLDAT.
    ENDFORM.                    " DYNPRO_DETAIL2
    FORM DYNPRO_DATE_SET USING    FELDNAME
                                  FELDINHALT.
      DATA: DATE TYPE D.
      CLEAR BDCDATA.
      CHECK FELDINHALT NE SPACE.
      BDCDATA-FNAM = FELDNAME.
      WRITE FELDINHALT  TO DATE.
      BDCDATA-FVAL = DATE.
      APPEND  BDCDATA.
    ENDFORM.                    " DYNPRO_DATE_SET
    FORM DYNPRO_HEAD_300.
      PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-KKAU.
    incoterms part 1
      IF NOT XVBAK-INCO1 IS INITIAL.
       PERFORM DYNPRO_SET USING 'VBKD-INCO1' XVBAK-INCO1.
      ENDIF.
    incoterms part 2
      IF NOT XVBAK-INCO2 IS INITIAL.
       PERFORM DYNPRO_SET USING 'VBKD-INCO2' XVBAK-INCO2.
      ENDIF.
    PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'BACK'.
    ENDFORM.                    " DYNPRO_HEAD_300
    FORM DYNPRO_POSITION.
      LOOP AT XVBAP.
    dynpro item double line entry
      PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'UER2'.
        IF XVBAP-POSNR = 1.
    material number
          PERFORM DYNPRO_SET      USING 'VBAP-MATNR(01)'   XVBAP-MATNR.
    order quantity
          PERFORM DYNPRO_SET      USING 'RV45A-KWMENG(01)' XVBAP-WMENG.
    desired delivery date
          PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(1)'  WLDAT.
    sales unit
          PERFORM DYNPRO_SET      USING 'VBAP-VRKME(1)'   XVBAP-VRKME.
        ELSE.
         PERFORM DYNPRO_SET      USING 'BDC_OKCODE'      'POAN'.
    material number
          PERFORM DYNPRO_SET      USING 'VBAP-MATNR(02)'    XVBAP-MATNR.
    order quantity
          PERFORM DYNPRO_SET      USING 'RV45A-KWMENG(02)'  XVBAP-WMENG.
    desired delivery date
          PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(02)'   WLDAT.
    sales unit
          PERFORM DYNPRO_SET      USING 'VBAP-VRKME(02)'    XVBAP-VRKME.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " DYNPRO_POSITION
    FORM RETURN_VARIABLES_FILL USING ERRORCODE.
    allocate IDOC numbers to Workflow output parameters
      IF MASS_PROCESSING <> SPACE.
        IF ERRORCODE = 0.
          RETURN_VARIABLES-WF_PARAM = PID.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          RETURN_VARIABLES-WF_PARAM = APO.
          RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
          APPEND RETURN_VARIABLES.
          WORKFLOW_RESULT = C_WF_RESULT_OK.
        ELSE.
          RETURN_VARIABLES-WF_PARAM = EID.
          RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
          APPEND RETURN_VARIABLES.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
        ENDIF.
      ELSE.
        IF ERRORCODE = 0.
          RETURN_VARIABLES-WF_PARAM = APE.
          RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
          APPEND RETURN_VARIABLES.
          WORKFLOW_RESULT = C_WF_RESULT_OK.
        ELSE.
          WORKFLOW_RESULT = C_WF_RESULT_ERROR.
        ENDIF.
      ENDIF.
    ENDFORM.                    " RETURN_VARIABLES_FILL
    Globale Daten von IDOC_INPUT_TESTER
    TABLES: E1HEAD, E1ITEM.
    DATA: BEGIN OF BDCDATA OCCURS 500.
            INCLUDE STRUCTURE BDCDATA.
    DATA: END OF BDCDATA.
    DATA: BEGIN OF XVBAK.                 "Kopfdaten
         INCLUDE STRUCTURE VBAK621.
    DATA: END OF XVBAK.
    DATA: BEGIN OF XVBAP OCCURS 50.        "Position
           INCLUDE STRUCTURE VBAP.
    DATA:  WMENG(18) TYPE C.
    DATA:  LFDAT LIKE VBAP-ABDAT.
    DATA:  KSCHL LIKE KOMV-KSCHL.
    DATA:  KBTRG(16) TYPE C.
    DATA:  KSCHL_NETWR LIKE KOMV-KSCHL.
    DATA:  KBTRG_NETWR(16) TYPE C.
    DATA:  INCO1 LIKE VBKD-INCO1.
    DATA:  INCO2 LIKE VBKD-INCO2.
    DATA:  YANTLF(1) TYPE C.
    DATA:  PRSDT LIKE VBKD-PRSDT.
    DATA:  HPRSFD LIKE TVAP-PRSFD.
    DATA: END OF XVBAP.
    DATA: BEGIN OF DYNPRO,
          EINSTIEG          LIKE T185V-DYNNR VALUE 101,
          KKAU              LIKE T185V-DYNNR,
          UER2              LIKE T185V-DYNNR,
          KBES              LIKE T185V-DYNNR,
          ERF1              LIKE T185V-DYNNR,
          PBES              LIKE T185V-DYNNR,
          PKAU              LIKE T185V-DYNNR,
          PEIN              LIKE T185V-DYNNR,
          EID1              LIKE T185V-DYNNR,
          POPO              LIKE T185V-DYNNR,
          EIPO              LIKE T185V-DYNNR,
          KPAR              LIKE T185V-DYNNR,
          PSDE              LIKE T185V-DYNNR,
          PPAR              LIKE T185V-DYNNR,
          KDE1              LIKE T185V-DYNNR,
          KDE2              LIKE T185V-DYNNR,
          PDE1              LIKE T185V-DYNNR,
          PDE2              LIKE T185V-DYNNR,
          PKON              LIKE T185V-DYNNR,
          END OF DYNPRO.
    DATA: BEGIN OF PANEL,
          KKAU              LIKE T185V-PANEL VALUE 'KKAU',
          UER2              LIKE T185V-PANEL VALUE 'UER2',
          KBES              LIKE T185V-PANEL VALUE 'KBES',
          ERF1              LIKE T185V-PANEL VALUE 'ERF1',
          PBES              LIKE T185V-PANEL VALUE 'PBES',
          PKAU              LIKE T185V-PANEL VALUE 'PKAU',
          PEIN              LIKE T185V-PANEL VALUE 'PEIN',
          EID1              LIKE T185V-PANEL VALUE 'EID1',
          EIAN              LIKE T185V-PANEL VALUE 'EIAN',
          POPO              LIKE T185V-PANEL VALUE 'POPO',
          EIPO              LIKE T185V-PANEL VALUE 'EIPO',
          KPAR              LIKE T185V-PANEL VALUE 'KPAR',
          PSDE              LIKE T185V-PANEL VALUE 'PSDE',
          POAN              LIKE T185V-PANEL VALUE 'POAN',
          PPAR              LIKE T185V-PANEL VALUE 'PPAR',
          KDE1              LIKE T185V-PANEL VALUE 'KDE1',
          KDE2              LIKE T185V-PANEL VALUE 'KDE2',
          PDE1              LIKE T185V-PANEL VALUE 'PDE1',
          PDE2              LIKE T185V-PANEL VALUE 'PDE2',
          PKON              LIKE T185V-PANEL VALUE 'PKON',
          KOAN              LIKE T185V-PANEL VALUE 'KOAN',
          END OF PANEL.
    DATA: BEGIN OF ERRTAB OCCURS 20,
           TRANS  LIKE TSTC-TCODE,
           ARBGB  LIKE T100-ARBGB,
           CLASS(1) TYPE C,
           MSGNR LIKE T100-MSGNR,
         TEXT LIKE T100-TEXT,
           TEXT(123) TYPE C,
           MSGV1 LIKE SY-MSGV1,
           MSGV2 LIKE SY-MSGV2,
           MSGV3 LIKE SY-MSGV3,
           MSGV4 LIKE SY-MSGV4,
          END OF ERRTAB.
    *---- Hilfsfelder     -
    DATA: PROGRAMM_AUFTRAG LIKE T185V-AGIDV VALUE 'SAPMV45A'.
    DATA: LAST_DYNPRO      LIKE T185V-DYNNR,
          WLDAT            LIKE VBAK-BSTDK,
          POSNR            LIKE VBAP-POSNR,
          FIRST(1)         TYPE C VALUE 'X'.
    DATA: BEGIN OF XBDCMSGCOLL OCCURS 10.
            INCLUDE STRUCTURE BDCMSGCOLL.
    DATA: END OF XBDCMSGCOLL.
    Terminauftrag  ( Auftragsart wird fest gesetzt !)
    DATA:   BELEGNUMMER LIKE VBAK-VBELN.
    DATA:   ERRORCODE LIKE SY-SUBRC.
    Statuswerte fuer IDOC-Status
    DATA:   BELEG_NICHT_GEBUCHT LIKE TEDS1-STATUS VALUE '51'.
    DATA:   BELEG_GEBUCHT       LIKE TEDS1-STATUS VALUE '53'.
    *- Direktwerte für Return_variables -
    data:
        eid like bdwfretvar-wf_param value 'Error_IDOCs',
        pid like bdwfretvar-wf_param value 'Processed_IDOCs',
        apo like bdwfretvar-wf_param value 'Appl_Objects',
        ape like bdwfretvar-wf_param value 'Appl_Object'.
    *- Direktwerte für Workflow_Result -
    DATA: C_WF_RESULT_ERROR LIKE BDWFAP_PAR-RESULT VALUE '99999'.
    thanks
    karthik
    DATA: C_WF_RESULT_OK    LIKE BDWFAP_PAR-RESULT VALUE '0'.

  • Function Module To read all the Files in a Given UNIX directory.

    Can anyone provide me with a FUNCTION MODULE which reads all the files available in a UNIX directory?
    I have the UNIX directory given. I need to find all the files available in that particular Directory so that I can choose and process accordingly. Probably I can store all files in an Internal Table.
    Thanks in advance.
    Sunil

    Hi Nick,
    Thankyou very much for the response.
    The Function Module /SAPDMC/LSM_F4_SERVER_FILE is interactive wherein we can select only one file.
    But my requirement is I need to collect (probably in an internal table) all the files exixting in the given UNIX directory.
    Can you please find in that direction. I would be very grateful.
    Thanks.
    Sunil

Maybe you are looking for

  • How can i pass NULL value in Store Procedure?

    Hi guys, I am calling one store procedure from MS SQL Server 200, i had create the follow layout: But i need pass to MSQL SEVER the CPF = NULL, when i execute the procedre the CPF send empty value (not null). I already changed Communication Channel p

  • Relationship b/w profit center Vs plants

    Dear FI-CO guru's Can u explain what type of relation ship can  we maintain plant to profit center , is there any assignment to plant vs profit center? and explain both aspect of view relationship between plant vs profit center thank in advance Regar

  • SUBSTR and INSTR function

    Hi Gurus, I have the data as follows: data 'BIDIE01H/TXT:ZUNE=HA011, CellIndex=144 /CAI:452-01-32201-47001/CAI:45201F7dc9b79a' 'BIDIE01H/TXT:ZUNE=HA111, CellIndex=124 /CAI:452-01-32201-471/CAI:45201F7dc9b79b' and I am trying to write a SQL to get the

  • KPA6 and report painter

    HI Everyone and Consultants, Well i am at abaper and dont have much knowledge in finance controling. First issue: Currently we update our budget using the t.code KPA6 using Profit Center and Cost element. It is succesfully getting update at KPA7. But

  • Sending event to display the ToolTipText

    HI Coders I've extended Jpanel and I draw an Image inside it so that Jpanel is the viewport of the image. In usual circumstances when i mouse over the image's viewport the ToolTip execute ,but in my case I need to execute the ToolTipText without actu