Function Module Syntactically errors

Dear Experts, 
This is function module for Extracting the data from Payroll cluster, it is throwing an error.
can any one look into this..
Types : Begin of LS_STR,
     PERNR type P_PERNR,
     SEQNR Type  CDSEQ,
     MOLGA Type  MOLGA,
     LGART Type  LGART,
     ANZHL Type  PRANZ,
     BETRG Type  MAXBT,
     WAERS Type  WAERS,
    END OF LS_STR.
  Types : Begin of LS_STR1,
PERNR type P_PERNR,
SEQNR Type  CDSEQ,
FPPER Type  FAPER,
INPER Type  IPERI,
FPBEG Type  FPBEG,
FPEND Type  FPEND,
SRTZA Type  SRTZA,
ABKRS Type  ABKRS,
PAYTY Type  PAYTY,
RUNDT Type  RUNDT,
RUNTM Type  RUNTM,
PAYDT Type  PAY_DATE,
PAYID Type  PAYID,
BONDT Type  BONDT,
OCRSN Type  PAY_OCRSN,
INOCR Type  PAY_OCRSN,
IPEND Type  IPEND,
   END OF LS_STR1.
   types  :begin of ty_pernr,
           pernr type persno,
          end of ty_pernr.
  Data :IT_STR TYPE STANDARD TABLE OF LS_STR,
         WA_STR LIKE LINE OF IT_STR,
         IT_STR1 TYPE TABLE OF LS_STR1,
         WA_STR1 LIKE LINE OF IT_STR1,
         PCL_T TYPE TABLE OF ZPSSTR,
         pcl_w type zpsstr,
         LV_RT TYPE LINE OF HRPAY99_RT,
         PCL_T1 TYPE STANDARD TABLE OF PC261, " Output structure of FM CU_READ_RGDIR.
         PCLW_T1 type pc261,
          PCL_T2 TYPE STANDARD TABLE OF PC261,
         PY_RESULT TYPE  PAY99_RESULT,
         IT_HRPAY99_RT TYPE HRPAY99_RT, " output structure of FM PYXX_READ_PAYROLL_RESULT.
         WA_RESULT type LINE OF HRPAY99_RT,
         LT_PA0008 TYPE TABLE OF LS_STR,
         LS_PA0008 LIKE LINE OF  LT_PA0008,
         LS_E_T_DATA LIKE LINE OF E_T_DATA,
         RELID  TYPE  RELID_PCL,
         PI_PERNR TYPE STANDARD TABLE OF ty_pernr,
         PW_PERNR LIKE LINE OF PI_PERNR,
*         PW_PERNR TYPE PA0008,
         MOLGA_T TYPE c LENGTH 2.
* Example: DataSource for table SFLIGHT
  TABLES: PCL2.
* Auxiliary Selection criteria structure
  DATA: L_S_SELECT TYPE SRSC_S_SELECT.
* Maximum number of lines for DB table
  STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
* counter
          S_COUNTER_DATAPAKID LIKE SY-TABIX,
* cursor
          S_CURSOR TYPE CURSOR.
* Select ranges
  RANGES: L_R_PERNR FOR PA0008-PERNR.
* Initialization mode (first call by SAPI) or data transfer mode
* (following calls) ?
  IF I_INITFLAG = SBIWA_C_FLAG_ON.
* Initialization: check input parameters
*                 buffer input parameters
*                 prepare data selection
* Check DataSource validity
*    CASE I_DSOURCE.
*      WHEN '0SAPI_SFLIGHT_SIMPLE'.
*      WHEN OTHERS.
*        IF 1 = 2. MESSAGE E009(R3). ENDIF.
** this is a typical log call. Please write every error message like this
*        LOG_WRITE 'E'                  "message type
*                  'R3'                 "message class
*                  '009'                "message number
*                  I_DSOURCE   "message variable 1
*                  ' '.                 "message variable 2
*        RAISE ERROR_PASSED_TO_MESS_HANDLER.
*    ENDCASE.
    APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
* Fill parameter buffer for data extraction calls
    S_S_IF-REQUNR    = I_REQUNR.
    S_S_IF-DSOURCE = I_DSOURCE.
    S_S_IF-MAXSIZE   = I_MAXSIZE.
* Fill field list table for an optimized select statement
* (in case that there is no 1:1 relation between InfoSource fields
* and database table fields this may be far from beeing trivial)
    APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
  ELSE.                 "Initialization mode or data extraction ?
* Data transfer: First Call      OPEN CURSOR + FETCH
*                Following Calls FETCH only
* First data package -> OPEN CURSOR
    IF S_COUNTER_DATAPAKID = 0.
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'PERNR'.
        MOVE-CORRESPONDING L_S_SELECT TO L_R_PERNR.
        APPEND L_R_PERNR.
      ENDLOOP.
IF L_R_PERNR IS INITIAL.
        OPEN CURSOR WITH HOLD S_CURSOR FOR
        SELECT DISTINCT PERNR  FROM PA0008.
ELSEIF L_R_PERNR IS NOT INITIAL.
        OPEN CURSOR WITH HOLD S_CURSOR FOR
        SELECT DISTINCT PERNR FROM PA0008 WHERE PERNR IN L_R_PERNR.
ENDIF.
FETCH NEXT CURSOR S_CURSOR
               APPENDING CORRESPONDING FIELDS
               OF TABLE PI_PERNR
               PACKAGE SIZE S_S_IF-MAXSIZE.
IF PI_PERNR IS NOT INITIAL.
**      LOOP AT PI_PERNR INTO PW_PERNR.
* Fill range tables BW will only pass down simple selection criteria
* of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
*SELECT PERNR from Pa0008 into TABLE PI_PERNR where PERNR <> 0.
*         SORT PI_PERNR BY PERNR.
*         DELETE ADJACENT DUPLICATES FROM PI_PERNR.
      loop at PI_PERNR into PW_PERNR.
        CALL FUNCTION 'CU_READ_RGDIR'
          EXPORTING
            PERSNR                   = PW_PERNR-PERNR
*   BUFFER                   =
*   NO_AUTHORITY_CHECK       = ' '
          IMPORTING
             MOLGA                    = MOLGA_T
          TABLES
            IN_RGDIR                 = PCL_T1
* EXCEPTIONS
*   NO_RECORD_FOUND          = 1
*   OTHERS                   = 2
        IF SY-SUBRC <> 0.
* Implement suitable error handling here
        ENDIF.
        CALL FUNCTION 'PYXX_GET_RELID_FROM_PERNR'
          EXPORTING
            EMPLOYEE                    = PW_PERNR-PERNR
          IMPORTING
            RELID                       = relid
*           MOLGA                       = MOLGA_T
          EXCEPTIONS
            ERROR_READING_INFOTYPE_0001 = 1
            ERROR_READING_MOLGA         = 2
            ERROR_READING_RELID         = 3
            OTHERS                      = 4.
        IF SY-SUBRC <> 0.
* Implement suitable error handling here
        ENDIF.
        LOOP AT PCL_T1 INTO PCLW_T1.
*  pcl_w-seqnr = pclw_t1-seqnr.
          CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
            EXPORTING
              CLUSTERID                          = relid
              EMPLOYEENUMBER                     = PW_PERNR-PERNR
              SEQUENCENUMBER                     = PCLW_T1-SEQNR
*   READ_ONLY_BUFFER                   = ' '
              READ_ONLY_INTERNATIONAL            = 'X'
*   ARC_GROUP                          = ' '
*   CHECK_READ_AUTHORITY               = 'X'
*   FILTER_CUMULATIONS                 = 'X'
*   CLIENT                             =
* IMPORTING
*   VERSION_NUMBER_PAYVN               =
*   VERSION_NUMBER_PCL2                =
            CHANGING
              PAYROLL_RESULT                     =  PY_RESULT
           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
             ERROR_READING_ARCHIVE              = 8
             ERROR_READING_RELID                = 9
             OTHERS                             = 10
          IF SY-SUBRC <> 0.
* Implement suitable error handling here
          ENDIF.
          loop at PY_RESULT-inter-rt into WA_RESULT.
            pcl_w-PERNR =   PW_PERNR-PERNR.              "PW_PERNR-PERNR.
            pcl_w-SEQNR =   PCLW_T1-SEQNR.
            pcl_w-LGART =   WA_RESULT-LGART.
            pcl_w-BETRG =   WA_RESULT-BETRG.
            pcl_w-ANZHL =   WA_RESULT-ANZHL.
            pcl_w-WAERS =   WA_RESULT-RTE_CURR.
            pcl_w-FPPER =   PCLW_T1-FPPER.
            pcl_w-INPER =   PCLW_T1-INPER.
            pcl_w-FPBEG =   PCLW_T1-FPBEG.
            pcl_w-FPEND =   PCLW_T1-FPEND.
            pcl_w-SRTZA =   PCLW_T1-SRTZA.
            pcl_w-ABKRS =   PCLW_T1-ABKRS.
            pcl_w-PAYTY =   PCLW_T1-PAYTY.
            pcl_w-RUNDT =   PCLW_T1-RUNDT.
            pcl_w-RUNTM =   PCLW_T1-RUNTM.
            pcl_w-PAYDT =   PCLW_T1-PAYDT.
            pcl_w-PAYID =   PCLW_T1-PAYID.
            pcl_w-BONDT =   PCLW_T1-BONDT.
            pcl_w-OCRSN =   PCLW_T1-OCRSN.
            pcl_w-INOCR =   PCLW_T1-INOCR.
            pcl_w-IPEND =   PCLW_T1-IPEND.
            pcl_w-MOLGA =  MOLGA_T.
          APPEND  PCL_W to E_T_DATA.
endloop.
endloop.
* READ TABLE pcl_t1 into pclw_t1 WITH Key SEQNR = wa_str-SEQNR.
*          APPEND  PCL_W to E_T_DATA.
*     APPEND pclw_t1 to pcl_t2.
*        ENDLOOP.
ENDLOOP.
*  MODIFY E_T_DATA
*      MOVE-CORRESPONDING  it_str to PCL_T.
*      MOVE-CORRESPONDING pcl_t1 to PCL_T.
*      LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.
*        MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
*        APPEND L_R_CARRID.
*      ENDLOOP.
*      LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
*        MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
*        APPEND L_R_CONNID.
*      ENDLOOP.
* Determine number of database records to be read per FETCH statement
* from input parameter I_MAXSIZE. If there is a one to one relation
* between DataSource table lines and database entries, this is trivial.
* In other cases, it may be impossible and some estimated value has to
* be determined.
*      OPEN CURSOR WITH HOLD S_CURSOR FOR
*      SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
*                               WHERE CARRID  IN L_R_CARRID AND
*                                     CONNID  IN L_R_CONNID.
*    ENDIF.                             "First data package ?
* Fetch records into interface table.
*   named E_T_'Name of extract structure'.
*    FETCH NEXT CURSOR S_CURSOR
*               APPENDING CORRESPONDING FIELDS
*               OF TABLE E_T_DATA
*               PACKAGE SIZE S_S_IF-MAXSIZE.
    IF SY-SUBRC <> 0.
*      CLOSE CURSOR S_CURSOR.
      RAISE NO_MORE_DATA.
    ENDIF.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
  ENDIF.              "Initialization mode or data extraction ?
ENDIF.
ENDIF.
ENDFUNCTION.
Regards
sree

There are so many threads and documentation available on the same..Please search the same.
Moreover if you share the error then it would be easy to know the exact problem
Regards,
AL

Similar Messages

  • Person no. not found - function module CONTACT_PARTNER_GET_ADDR3_KEY error

    Hi SAP Experts,
    The New contact person created in CRM 4.0 and added to BP under relationships , this contact is not replicated to ERP and giving an error as "Person no. not found - function module CONTACT_PARTNER_GET_ADDR3_KEY error
    " in the BDOC.
    Can anyone through some light on this .
    Thanks in advance.
    With Best Regards
    Suchhi

    hello,  you mentioned that the contact has a relationship with a person right?
    Is the person also exist in ERP?
    As the middleware return the error CONTACT_PARTNER_GET_ADDR3_KEY ,  you can try to debug the BDOC to find out the reason.
    You can set the breakpoint in the function , trigger the BP update, wait for system call it. But debug BDOC need some skill.
    For the details of how to debug BDOC, you can find the related SAP Notes in SAP OSS.

  • Function module throwing error from work area. Cannot find the problem...

    REPORT  ZPSMARTFORM1.
    tables: zptable1.
    types: begin of ty_zptable1,
          f1 type zf1,
          f2 type zf2,
          f3 type zf3,
    end of ty_zptable1.
    data: itab type table of ty_zptable1 with header line.
    data: wa type ty_zptable1.
    select f1 f2 f3 from zptable1 into table itab.
    CALL FUNCTION '/1BCDWB/SF00000005'
    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
        ITAB                       =   .
    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.
    this is my driver program.In my form interface  there are tables,import,export are there where i have to declare tables data.If i am putting wa means it is throwing error.Please show me the clear information.
    Edited by: Julius Bussche on Nov 14, 2008 10:09 AM

    REPORT ZPSMARTFORM1.
    tables: zptable1.
    types: begin of ty_zptable1,
    f1 type zf1,
    f2 type zf2,
    f3 type zf3,
    end of ty_zptable1.
    data: itab type table of ty_zptable1 with header line.
    data: wa type ty_zptable1.
    select f1 f2 f3 from zptable1 into table itab.
    CALL FUNCTION '/1BCDWB/SF00000005'
    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
    ITAB = .
    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.
    Plz for this driver program. Give me the exact solution.I am passing the information like itab  like zptable1 ther ein the smart form table. Even now i am getting error.Here in this driver program i passed itab = itab means .I  am not getting solution.If i have to change any function module name means plz tell me.What i have to put there.Plz give me the correct solution

  • Inbound Function Module SM58 Error in Outbound R3- XI- file Scenario

    I am getting an SM58 error message of "Use IDOC Adapter for FM IDOC_INBOUND_ASYNCHRONOUS...." in my R3 system when trying to implement an Outbound R3->XI->file Scenario.  This implies that the system thinks I am doing inbound when I am really doing an outbound IDoc to XI. I followed the guides and seem to have everything set up properly.
    I also found a closed posting concerning the same error message, but there was no resolution.
    My idoc also appears fine (outbound, right ports). To test, I changed my XI rfcDestination to an EDI System rfcDestination and the ORDRSP outbound idoc goes to the edi system as expected.
    Any idea why my R3 system thinks I am using IDOC_INBOUND_ASYNCHRONOUS?
    Thanks in advance!

    Hi,
    I have couple questions before exactly answering your question
    What type of data you are trying to send like
    1. Master data (Customer master, Vendor master)
    2. Transactional data (Sales orders, Purchase orders)
    If you are trying to send transactional data then check the partner profile configuration for whom you are trying to create outbound IDocs. Select your partners outbound message type and go to Message Control details tab and check your Process code and corresponding functional module if the function module used is ment for creating outbound Idocs then there should be some other that is causing the problem otherwise I guess this is the problem so you can change the associated process code function module.
    Jagadish.

  • Executing function module gives error "Portal request failed: Connection fa

    Dear Experts,
    I have a Function module  Z_SAT_CREDITLIMIT_CHANGE which in itself accesses the SAP Update Function module
    UPDATE/INSERT  of the credit limit(CREDITLIMIT_CHANGE)
    and writes the changed data to the Table KNKK(Customer Master Credit Management : Control Area Data).
    While executing this fn module Z_SAT_CREDITLIMIT_CHANGE
    from VC storyboard i received error "Portal request failed:
    Connection failed: Nested Exception: Native Connection to backend system is broken" . Z_SAT_CREDITLIMIT_CHANGE executes fine and updates data in ECC system.
    Than i noticed further that while commenting the part of code in Z_SAT_CREDITLIMIT_CHANGEwhere call to fn module CREDITLIMIT_CHANGE is made there's no error recieved and Z_SAT_CREDITLIMIT_CHANGE executes without error but obviously no data is updated.
    Appreciate if any one can please explain how can i use CREDITLIMIT_CHANGE  in Z_SAT_CREDITLIMIT_CHANGE
    without any errors.
    Kind Regards,
    Robin.

    Hi Robin,
    Also, check that the user with the one you're accessing to the backend have permissions to execute the Dataservice at the backend system.
    You should check the usermapping to know which is the user at backend.
    Best Regards,
    Luis

  • FUNCTION MODULE FOR ERROR LOG IN BILLING OF SALES ORDER

    Hello,
    Is there any way through which I can access the error log generated while releasing billing through vfx3?
    Is tehre any function module or table for the same?
    Regards,
    Krutika

    the problem resolved myself.

  • Rfc function module call error

    Hi Abaper,
    I'm doing upgrade from 4.7 to ecc 6.0 currently and encounter problem in one of the rfc function module that we used. I've tested the connection to destination using sm59 and the connection is successful.
    As an information, in the rfc setting, the target system is not Unicode system.
    When I test using se37 and put the rfc destination in my function module call, I always encountered system_error exception. There's no issue with this rfc call before in 4.7 system.
    Please help me on this. Thank you.
    Edited by: Abraham Bukit on Sep 3, 2008 2:36 AM

    Hi,
    I had the same issue in the past and solved it in the following way.
    If the destination system is not Unicode please try to set the password for the communication user set in SM59 using only upper-case characters and taking into account that the password shouldn't be longer than 8 characters.
    Hope this will help.

  • Function module for error message with language param

    any Function Module that has language param in it?
    thanks,

    Dear Rayann,
    Use FM FORMAT_MESSAGE.
    Thanks & Regards,
    Nagaraj Kalbavi

  • Error with data transfer in functional module

    Hi all,
    I need to upload file to the employee through BDS. (oaor transcation).  i am using functional module
    function zin_bds_dms_upload.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(P_CLASS) TYPE  BDN_CON-CLASSNAME
    *"     VALUE(P_OBJCT) TYPE  BDN_CON-OBJKEY
    *"     VALUE(P_DESCR) TYPE  BDN_CON-DESCRIPT
    *"     REFERENCE(P_PATH) TYPE  SAPB-SAPFILES
      data: begin of i_bds_conn occurs 10, " ITAB for the actual
             bdn_tab_i type  num08,
            client type mandt,
            classname type      seoclsname,
            classtype     type bds_clstyp,
            objkey  type  bds_typeid,
            log_system    type swo_typeid,
            loio_id   type char42,
            doc_ver_no    type num08,
            doc_var_id    type num08,
            doc_var_tg    type bds_var_tg,
            descript    type sdok_descr,
            langu   type spras,
            comp_id   type bds_compid,
            mimetype  type  bds_mimetp,
            crea_user   type sdok_crusr,
            crea_time   type sdok_crtst,
            chng_user   type sdok_chusr,
            chng_time   type sdok_chtst,
            contrep   type bds_conrep,
            docuclass   type sdok_prv_m,
            doc_type    type sdok_prv_s,
            expirytime    type sdok_prv_m,
            bds_docid   type sdok_prv_l,
            loio_id_to    type sdok_loid,
            rela_id     type      bds_relaid,
            state   type sdok_phsta,
            bds_status    type bds_state,
            stor_tab  type saearstat,
            bdn_tab_d     type bar_keep,
            note_type     type bds_state,
            objecttext type toasp-objecttext,
            objecttext2 type toasd-objecttext,
            objecttext3 type toasr-objecttext,
            ntext type tojtt-ntext,
    end of i_bds_conn.
      data: begin of bds_doctype_list occurs 10,
      mandt type mandt,
      classname type bapibds01-classname,
      contrep type bapibds01-contrep,
      docuclass type bapibds01-doc_class,
      docuclass_text type toasd-objecttext,
      doc_type type bapibds01-doc_type,
      doc_type_text type toasp-objecttext,
      appl_type type toadd-appl_type,
      appl_type_text(50) type c,
      standard type toadv-standard,
      check_box type toadv-standard,
      end of bds_doctype_list.
      data: file_extension type toadd-doc_type, " file-extension
      i_files type bapifiles occurs 1 with header line,
      i_signature type bapisignat occurs 1 with header line,
      logical_system type bds_conn00-log_system.
      data: classname_select type bdn_con-classname,
      classtype_select type bdn_con-classtype,
      objkey_select type bdn_con-objkey,
      mask(20) type c,
      answer type c,
      mimetype type toadd-mimetype,
      i_toadd type toadd,
      file_path type sapb-sapfiles,
      filename_all type sapb-sapfiles,
      file_path_memory(250) type c, " path für SAP memory
      file_path_length type i, " length of the file_path
      file_name type sapb-sapfiles.
      classname_select = p_class.
      classtype_select = 'BO'.
      objkey_select = p_objct.
      filename_all = p_path.
      get parameter id 'OAP' field file_path.
      if sy-subrc <> 0. " no file_path found.
        file_path = space.
      endif.
      concatenate ',.' '' ',.' '' '.' into mask.
    -- split filename -- *
      perform split_path(oaall) using filename_all file_path file_name.
    -- set new file_path to SAP memory -- *
      file_path_length = strlen( file_path ).
      if file_path <> space and file_path_length < 250.
        file_path_memory = file_path.
        set parameter id 'OAP' field file_path_memory.
      else.
        file_path_memory = space.
        set parameter id 'OAP' field file_path_memory.
      endif.
    -- check documentclass -- *
      perform get_file_extension using file_name
      file_extension.
    -- check file extension -- *
      if file_extension = space.
    -> if no docuclass is found from the document
    -> default docuclass from the doctype!
        file_extension = bds_doctype_list-docuclass.
      endif.
    -- get the mimetype of the docuclass -- *
      perform mimetype_get(oaall) using file_extension
      changing i_toadd.
      move i_toadd-mimetype to mimetype.
    -- fill file and signature structure -- *
      clear: i_files, i_signature.
      refresh : i_files, i_signature.
      i_files-doc_count = 1.
      i_files-directory = file_path.
      i_files-filename = file_name.
      i_files-mimetype = mimetype.
      append i_files.
      i_signature-doc_count = 1.
      i_signature-prop_name = 'BDS_DOCUMENTCLASS'.
      i_signature-prop_value = file_extension.
      append i_signature.
      i_signature-prop_name = 'BDS_CONTREP'.
      if bds_doctype_list-contrep = space.
        i_signature-prop_value = ' '.                           "#EC NOTEXT
      else.
        i_signature-prop_value = bds_doctype_list-contrep.
      endif.
      append i_signature.
      i_signature-prop_name = 'BDS_DOCUMENTTYPE'.
      i_signature-prop_value = bds_doctype_list-doc_type.
      append i_signature.
      i_signature-prop_name = 'DESCRIPTION'.
      i_signature-prop_value = p_descr.
      append i_signature.
      i_signature-prop_name = 'LANGUAGE'.
      i_signature-prop_value = sy-langu.
      append i_signature.
    -- create new document via KPro -- *
      call function 'BDS_BUSINESSDOCUMENT_CREATEF'
        exporting
          logical_system = logical_system
          classname      = classname_select
          classtype      = classtype_select
          client         = sy-mandt
          object_key     = objkey_select
        tables
          files          = i_files
          signature      = i_signature
        exceptions
          internal_error = 1
          others         = 2.
    endfunction.
    *& Form GET_FILE_EXTENSION
    try to get the extension of the uploaded file
    form get_file_extension using file_name file_extension.
    -- data declaration ------------------------------------------------ *
      data: length type i,
      single_c type c.
      data: begin of bds_doctype_list occurs 10,
      mandt type mandt,
      classname type bapibds01-classname,
      contrep type bapibds01-contrep,
      docuclass type bapibds01-doc_class,
      docuclass_text type toasd-objecttext,
      doc_type type bapibds01-doc_type,
      doc_type_text type toasp-objecttext,
      appl_type type toadd-appl_type,
      appl_type_text(50) type c,
      standard type toadv-standard,
      check_box type toadv-standard,
      end of bds_doctype_list.
      clear: single_c.
      length = strlen( file_name ).
      if length > 0.
        while length > 0.
          single_c = file_name+length(1).
          if single_c co '.'.
            length = length + 1.
            exit.
          else.
            length = length - 1.
          endif.
        endwhile.
        if length > 0.
          file_extension = file_name+length.
        else.
          file_extension = space.
        endif.
      else.
        file_extension = space.
      endif.
      if file_extension <> space.
        set locale language sy-langu.
        translate file_extension to upper case.              "#EC TRANSLANG
        set locale language space.
      endif.
    endform.                    "get_file_extension
    example  : class = PREL
    object = pernr_no
    desc =  'leav application'
    p_path = file_path
    I used this in abap program then it is uploading fine but when used in the web dynpro file is not uploading. On debugging it is showing error in function module SDOK_PHIOS_CHECKIN
    error key 5 ie error in transfer.
    So please suggest how to upload in web dynpro abap.
    Edited by: Bhavya belagal on Dec 22, 2010 11:55 AM
    Edited by: Bhavya belagal on Dec 22, 2010 12:09 PM

    Hallo Bhavya,
    Please do not post like this as it is not readable . Mostly when you describe it in a simple manner you would get more response.
    See this thread for answers from Thomas Jung [Re: Approach content repository other way then URL approach|Re: Approach content repository other way then URL approach]
    Wiki [http://wiki.sdn.sap.com/wiki/display/WDABAP/File%2bUpload%2busing%2bcl_fitv_gos%2bclass|http://wiki.sdn.sap.com/wiki/display/WDABAP/File%2bUpload%2busing%2bcl_fitv_gos%2bclass]
    Edited by: Baskaran Senthivel on Dec 22, 2010 2:42 PM

  • Syntax Error with Table Parameter (type: ANY) when Creating Function Module

    Hello experts,
    I want to create a function module with a table parameter and table type is ANY. But when I check (Ctrl+F7) this function module, syntax error occurs - "In this statement, the internal table "MSG_TABLE_ITEM" must have the type "STANDARD TABLE"."
    Could anyone tell me what the wrong is? And how can I fix it?
    Thanks,
    Shelwin

    Hi,
    For table parameters, you can only pass
    MSG_TABLE_ITM   TYPE STANDARD TABLE
    or
    MSG_TABLE_ITM  ( don't fill other columns TYPING ASSOCIATED TYPE  ).
    For reference check FM 'GUI_UPLOAD' - Table parameters
    Regards,
    DPM

  • Error on SAPLZ001 program after deletion of Function Module

    Hi,
    I got some problem with my datasource (processed by a function module), this error occurs after I delete the FM in D because this will not be used in Q.
    Below is the details of my problem, Hope you can help me soon. thank you very much
    Includes LSVIMFTX
    Field "FORBIDDEN_FUNC_NAME_CHARS" is unknown
    History of the problem:
    After Q refresh, we need to retransport all TR that are existing to Q01
    before the refresh.
    The Error occurs when retransporting existing Datasource process by a
    function module to Q01
    Error Message:
    Program SAPLZ001, Include LZ001UXX: Syntax error in line 000011
    INCLUDE report 'LZ001U07' not found
    this is because 1 function module is missing in the Q but the FM name
    exist in the LZ001UXX under LZ001U07.
    But since the missing FM is no longer needed, I decided to delete this
    FM in Dev and transport the changes done to Q, hoping that the failed
    datasource transport will be successful after retransport.
    After I did the deletion, a new error occurs when releasing the TR, it
    says:
    Includes LSVIMFTX
    Field "FORBIDDEN_FUNC_NAME_CHARS" is unknown
    I check manualy the program LSVIMFTX and it says there is no syntax
    error.
    But when I check SAPLZ001 program the error occurs.

    The FM is for data extraction, I created a Datasource that processed by a FM.
    Yes, I get this error in Dev originally, but before I deleted the FM in D, this work fine and when I deleted and transported the action "delete FM" to Q it fails, then when I check it in Q the Q now is having the same problem with D.
    I am trying to change the version in D and transported to Q, but transport always fails.
    changing version didnt fix the problem with.
    Thank you very much for your time...

  • Type RAW not accepted in function module for workflow

    Hi,
    this is a crazy thing for me:
    I like to start a workflow from a report.
    Usually will use the function module SWU_START_WORKFLOW".
    Usually this is no problem.
    Here is my current problem:
    One of the elements I have to transfer to workflow is defined with
    ZELEMENT like SXMSMGUID.
    SXMSMGUID is from type RAW.
    This type is not supported in the container element transfer.
    Tried to transfer it as CHAR.
    ZELEMENT type c,
    ZELEMENT = SXMSPEMAS-MSGGUID.
    So put the RAW element into a char element.
    Error in function module:
    Program error: ASSIGN with length 0 in program "SAPLSWA8".
    Error analysis
        An ASSIGN statement in the program "SAPLSWA8" contained a field symbol with
        length 0. This is not possible.
        length 0.
        This is not possible.
    I need that element to be transferred to the workflow.
    But how to solve that problem?
    How to move the RAW element readable into a char element (This type usually is no problem in the FM)
    Any ideas are welcome!
    Best regards
    Dirk

    ya i know that ..But I wanted to create a simple one..moreover the problem is not with bdc....It is with the function module interface..
    Also I want to ask a question that I had to define all the parameters (in the function module ) by data declaration statements in the function group top include..
    If i dont do that say the first error is when i write loop at idoc_contrl ..idoc_contrl is not declared by a data statement..So IO had to write a data statement:
    Idoc_contrl type table of edidc..I have seen that in other function modules (idoc inbound processing)  no such data declaration is done..

  • Hierarchial Layout Saving with function modules

    Hai to all
    i am facing a problem while saving layout in Hierarchial list display with function module.
    below error message is coming when i am going save my layout.
      210     if l_def_variant-variant eq rs_variant-variant.                
      211       l_default = 'X'.                                             
      212     endif.                                                         
      213   endif.                                                           
      214                                                                    
      215   call function 'LT_FC_SAVE'                                       
      216        exporting                                                   
      217 *           I_TOOL            = 'LT'                               
      218             i_tabname         = r_tabname                          
      219             i_tabname_slave   = r_tabname_slave                    
      220             is_variant        = rs_variant                         
      221             it_fieldcat       = rt_fieldcat[]                      
      222             it_sort           = rt_sort[]                          
      223             it_filter         = rt_filter[]                        
      224             is_layout         = rs_layout                          
      225             i_default_variant = l_default                          
      226        exceptions                                                  
      227             fc_not_complete = 1                                    
      228             others          = 2.                                   
      229   case sy-subrc.                                                   
      230     when '0'.                                                      
      231       message s018(0k).                                            
      232     when '1'.                                                      
    >>>>>       message x000(0k) with 'LT_FC_SAVE' sy-subrc                  
      234               raising fc_not_complete.                             
      235   endcase.                                                         
    it is very urgent...
    Subhash.M

    data: ls_vari      type disvariant.
    DATA: w_repid      TYPE sy-repid.
      ls_vari-report      = w_repid.
      ls_vari-username    = sy-uname.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
      I_INTERFACE_CHECK              = ' '
         i_callback_program             = w_repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
         is_layout                      = wa_layout
          it_fieldcat                    = i_fcat[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
       it_sort                        = i_sort[]
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
         i_default                      = 'X'
         i_save                         = 'X'
       IS_VARIANT                     = ls_vari
       it_events                      = i_event[]
      IT_EVENT_EXIT                  =
          i_tabname_header               = 'I_FINAL1'
          i_tabname_item                 = 'I_FINAL2'
      I_STRUCTURE_NAME_HEADER        =
      I_STRUCTURE_NAME_ITEM          =
          is_keyinfo                     = wa_key
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                =
      IR_SALV_HIERSEQ_ADAPTER        =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          t_outtab_header                = i_final1
          t_outtab_item                  = i_final2
    EXCEPTIONS
       PROGRAM_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.
    i have passed the parameters
    but i am getting same dump again..
    Subhash.M

  • Error while passing a table to a function module

    Hi Iam passing a table g_tab of length 376 flat structure to the function module..under TABLES section parameter.
    Changedocument_read_headers.
    iam getting a complile time error like the below displayed thing. Can u tell me how to solve this ?
    In the function module interface, you can specify only
    fields of a specific type and length under "I_CDHDR".
    Although the currently specified field
    "G_CDHDR_TAB" is the correct type, its length is incorrect.
    Edited by: kiran kumar on Jul 7, 2008 8:53 AM

    probably u making a mistake while declaring the table
    declare it like this in the tables section:
    S_JOB     LIKE     RNGE_OBJID
    where s_job is the internal table name and RANGE_OBJID is a structure type and NOT an internal table type.

  • RFC Error While Invoking A Remote Function Module.

    I am invoking A remote function module while invoking it get  an exception when i see the error logs
    com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException:      Screen output without connection to user.                           , error key: RFC_ERROR_SYSTEM_FAILURE at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:101) at... [see details]
    can anyone pls tell me what the error is..
    regards
    Nilesh Taunk.

    Hi Nilesh Taunk,
    You can go through the following steps
    -o JCO Exceptions 1. http://help.sap.com/saphelp_nw04s/helpdata/en/f6/daea401675752ae10000000a155106/frameset.htm
    -o JCO Exceptions 2. http://help.sap.com/saphelp_nw04/helpdata/en/f6/e002416225f023e10000000a155106/frameset.htm
    -o Restart of the J2EE instance and try re-importing the RFC model. Sometimes it helps.
    -o Logon into WebDynpro Content Administrator as a J2EE Admin and check if the JCO Connections and User /pwd of your application is correct. You can <b>ping </b>or <b>test your JCO connections</b>. if something is wrong, enter the values again for JCO n retest them.
    -o Try undeploying or removing the complete application and redeploy it.
    Tu undeploy please go to
    Go to <b>Visual Admin -> Server -> Services -> Deploy ->
    </b>
    Under Runtime Tab
    select the server, open the tree , you would find the webdypro list there.
    Now select an application, first stop it, remove it and redeploy if necessary.
    Let us know if you could solve the problem or not, gud luck!
    Rgds,
    Sreenivas.

Maybe you are looking for

  • MSI GT70 2PC Dominator (happens to similar msi's too) WiFi Spikes/in-game lags and freezes IMPORTANT

    Ok so I've been searching this all around, it is a common issue. I have tried many fix's but if anyone has an idea please suggest. If anyone has had this issue and now it's fixed please tell me. It is clearly the wifi hardware or software from MSI. I

  • Why is the Java runtime resource hungry and slow?

    Hi, First of all let me make it clear that I'm not here to bash Java. I'm a big fan of the technology. In fact I believe in its potential as it is the only true 100% cross-platform runtime. Now that it has been open sourced, it has just made me happi

  • Wi fi not connected message

    My ipad 2 wi fi is not working,  I get a Not Connected message.  Has anyone had this problem? if so what is the solution to be able to reconnect. Thanks

  • [solved]terminus font without xorg.conf

    Hi I start X without a xorg.conf as every conf I tried did not work. Without the conf X works perfectly. But I now want the terminus font for my WM and pacman installed them in /usr/share/fonts/local This directory is not recognized by X by default.

  • Calculate Paths without endNode

    Hi I was using the Java APIs to calculate paths for my network by giving only the starting node and a constraint. Is the same option available in PL/SQL procedures? From what I see u have to define an end node also Thank u K