Regarding Function Module Execution

Hi Friends
I am using the FM: ARCHIVFILE_SERVER_TO_CLIEN.
With the parameters:
Path = /tmp/TEST EMP COMP COE ECM_MB_07.txt
And target Path = c:\Bonusbudget\TEST EMP COMP COE ECM_MB_07.txt
While executing this FM , if I checked the uppercase/lower case checkbox, I am getting the proper results otherwise I am getting the error that:
Error in opening file /TMP/TEST EMP COMP COE ECM_MB_07.TXT for reading (No such file or directory).
As I am calling this in my program and getting the above error.
Can anyone please suggest me the solution for this.
Points are assured for useful answers.
Regards,
Sreeram

Hi Nick
Thanks.
See my code to correct:
VARIABLE DECLARATION
  DATA: lv_single_line TYPE string, "To split the file contents
        lv_objid TYPE hrobjid,      "Holds the Org Unit ID
        p_file TYPE rlgrap-filename,"File from Application Server
        lv_file_budget TYPE string. "Source File Name
  DATA: it_orgunit     TYPE hap_t_hrsobid    ,     " Id of Org. unit
        it_suborgunits TYPE hap_t_hrsobid    ,     " Ids of Sub Org Units
        wa_orgunit     TYPE LINE OF hap_t_hrsobid ," Work Area of orgunit
        lv_sobid       TYPE hrp1001-sobid      ,   " Org. Unit
        lv_stext TYPE stext,                       "Org.Unit Description
        lv_user TYPE sy-uname ,                    "User
        lv_afile TYPE epsf-epsfilnam,              "Application Server file name
        lv_objid1 TYPE hrobjid,     "Holds the Org Unit ID
        lv_uzeit TYPE syuzeit,      "Application Server's time
        lv_tpath TYPE sapb-sappfad, "Target Path on the Desktop
        lv_spath type SAPB-SAPPFAD. "Source File
CONSTANTS DECLARATION     
  CONSTANTS: c_split(5) TYPE c VALUE ' ', " File spliting indicator
             c_rsign TYPE rsign VALUE 'A', "Relationship Indicator
             c_relat TYPE relat VALUE '300',"Relation ship
            c_file(255) TYPE c VALUE '/tmp/Bonusfile3.txt',
              c_file(255) TYPE c VALUE '/tmp/Sample Budget Upload File.txt',
             c_currency(5) TYPE c VALUE 'USD'.
  CONSTANTS: c_plvar(4) TYPE c VALUE '01', "Plan Version
             c_o(3) TYPE c VALUE 'O',      "Object
             c_otype(4) TYPE c VALUE 'BU', "Object type
             c_rsign1 TYPE rsign VALUE 'B'."Relationship
  CONSTANTS : c_x(3) TYPE c VALUE 'X',
              c_0(3) TYPE c VALUE '0',
              c_usd(5) TYPE c VALUE 'USD'.
  CONSTANTS: c_otype1 TYPE otype VALUE 'US', "Object Type for User
             c_otype2 TYPE otype VALUE 'O', "Org.Unit
             c_evalpath TYPE gdstr-wegid VALUE 'SAP_MANG', "Evaluation path
             c_depth TYPE hrrhas-tdepth VALUE '0',"Depth
             c_underscore TYPE c VALUE '_', "Underscore
             c_mb(4) TYPE c VALUE 'MB',     "Merit Bonus
             c_pb(4) TYPE c VALUE 'PB',     "Performance Bonus
             c_spot(6) TYPE c VALUE 'SPOT', "Spot Bonus
             c_star TYPE c VALUE '*',       "To fecth all files
             c_dirname TYPE epsf-epsdirnam VALUE '/tmp', "Directory name
             c_tpath TYPE sapb-sappfad VALUE 'c:\Bonusbudget\'. "Target Path on the Desktop
INTERNAL TABLE DECLARATION.
  TYPES: BEGIN OF ty_budget,
           orgunit TYPE orgeh,             "Org.Unit
           kcurr TYPE cmp_bu_kcurr,        "Monetery Falg
           butyp TYPE ecm_butyp,           "Budget Type
           budgetperiod TYPE cmp_bu_finyr, "Budget Period
           oldam(20) TYPE c,               "Amount
           oldcu TYPE waers,               "Currency
         END OF ty_budget.
  DATA: it_budget TYPE STANDARD TABLE OF ty_budget,
        wa_budget TYPE ty_budget.
*INTERNAL TABLE & WORK AREA HOLDS THE MANAGER ORG.UNIT
  DATA: it_obj_tab_tmp TYPE STANDARD TABLE OF hrrootob.
  DATA: wa_obj_tab_tmp TYPE hrrootob.
  DATA: it_dir_list TYPE STANDARD TABLE OF epsfili,
        wa_dir_list TYPE epsfili.
  lv_user = sy-uname.
  lv_uzeit = sy-uzeit.
  lv_user = 'DALKW1'.
  p_file = c_file.
  lv_file_budget = p_file.
  CALL FUNCTION 'RH_STRUC_GET'                              "#EC *
    EXPORTING
      act_otype      = c_otype1
      act_objid      = lv_user
      act_wegid      = c_evalpath
      act_begda      = sy-datum
      act_endda      = sy-datum
      act_tdepth     = c_depth
    TABLES
      result_tab     = it_obj_tab_tmp
    EXCEPTIONS
      no_plvar_found = 1
      no_entry_found = 2
      OTHERS         = 3.
  LOOP AT it_obj_tab_tmp INTO wa_obj_tab_tmp.
    lv_objid1 = wa_obj_tab_tmp-objid.
  ENDLOOP.
  SELECT SINGLE stext
  FROM hrp1000
  INTO lv_stext
  WHERE otype = c_otype2
  AND objid = lv_objid1.
  IF sy-subrc EQ 0.
    CONCATENATE lv_stext+0(18) c_star INTO lv_afile.
  ENDIF.
GET THE FILE NAMES BY PASSING THE DIRECTORY NAME AND FILE NAME.
  CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
    EXPORTING
      dir_name               = c_dirname
      file_mask              = lv_afile
    TABLES
      dir_list               = it_dir_list
    EXCEPTIONS
      invalid_eps_subdir     = 1
      sapgparam_failed       = 2
      build_directory_failed = 3
      no_authorization       = 4
      read_directory_failed  = 5
      too_many_read_errors   = 6
      empty_directory_list   = 7
      OTHERS                 = 8.
  IF sy-subrc EQ 0.
    LOOP AT it_dir_list INTO wa_dir_list.
      CONCATENATE c_tpath wa_dir_list-name INTO lv_tpath.
      lv_spath = wa_dir_list-name.
     concatenate c_dirname '/' lv_spath  into lv_spath.
DOWNLOAD THE FILE TO THE PRESENATATION SERVER PATH.
      CALL FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'
        EXPORTING
          path       = lv_spath
          targetpath = lv_tpath
        EXCEPTIONS
          error_file = 1
          OTHERS     = 2.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename = lv_tpath
            filetype = 'ASC'
          TABLES
            data_tab = it_budget.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
      CLEAR lv_tpath.
    ENDLOOP.
  ENDIF.
Regards,
Sree

Similar Messages

  • Query regarding function module SPOOL_RQ_READ_BAPI_EXPORTS (EBP-SRM Module)

    query regarding function module SPOOL_RQ_READ_BAPI_EXPORTS (EBP-SRM Module)
    shopping cart
    Hi in FM SPOOL_RQ_READ_BAPI_EXPORTS
    i want to relate the internal tables requisition_items and requisition_services.
    but in am not getting the key on which they should be joined
    here i have to take the quantity and other fields from requisition_services
    right now i am using the joining condition as
    requisition_items-pckg_no = requisition_services-pckg_no.
    any help in this regard is welcome.
    Thanks and regards,
    Vithalprasad

    Hi Kathirvel,
    Thank you for reply. I am making changes for standard code only.
    " Call FM SPOOL_DPO_READ_BAPI_EXPORTS to read PO data exported to backend.
    Use this data to call FM B46B_DPO_TRANSFER and copy errors tab from
    ' lt_bapi_return ' to ' et_messages' retrun tab in 'doc_check' badi. "
    Thank you.
    Regards, Sunu

  • Scheduling function module execution in background jobs

    Hi,
    I have requirement where in after obtaining all the required inputs from the user we will call an function module to execute it.
    The requirement is that the execution of fm shld happen in background and a log must be created showing the user whther it was successful or if it failed with the list of errors.
    Can you kindly give some input on how to schedule the execution of function module in background job and if scheduled how to create the logs to display the success or error message.
    Warm Regards,
    Naveen M

    Hi,
    Just create a simple program where you have to call this FM.
    Pass the values to FM either by declaring some internal table of selection screen and execute the program in background.
    For Message Log, you can use structurre BDCMSGCOLL
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    After Call to FM, read from this internal table as follows
    READ TABLE MESSTAB WITH KEY MSGTYP = <Message Type>
                                            MSGNR  = <Message Number>.
    regds,
    Anil

  • Regard functional module

    Hey guys,
    Issue regarding Func module.
    If any Functional module we execute in SE37, gives
    exception(if we give any unproper data as input.).
    But inside the program, if we want to catch that exception how to do.
    if sy-subrc <> 0 then i want to raise that particular
    standard exception which was displayed in SE37 execution.
    Any ideas.
    ambichan.

    Hi
    Check this thread -
    Re: Function Module Exceptions handling
    Cheers.
    ( Dont forget to reawrd if answers were helpful )

  • Regarding Function Module 'SO_NEW_DOCUMENT_SEND_API1'

    Hi All,
    I am having a issue in using Function Module 'SO_NEW_DOCUMENT_SEND_API1'.
    <b>I am presently sending the E-mail as follow:</b>
    From: [email protected]
    To: [email protected]
    Subject: You have Missing Time
    Please Do Not Respond To This E-mail  ***
    BOHAN          JAMES     P. S25751
    07/01/2005 4.00 HRS
    07/07/2005 4.00 HRS
    07/27/2005 1.50 HRS
    For any missing time greater than 30 calendar days, please complete a Salary Request for Labor Hours Transfer Form (SA8250).  If you have any questions, please contact Salary Timekeeping on extension 6-5571 or 6-5500.  
    <b>But the user wants it to be in following way:</b>
    From: [email protected] [mailto:[email protected]]
    Sent: Monday, August 15, 2005 10:44 AM
    To: [email protected]
    Subject: You have Missing Time
    Please Do Not Respond To This E-mail  ***
    BOHAN          JAMES     P. S25751
    07/01/2005 4.00 HRS
    07/07/2005 4.00 HRS
    07/27/2005 1.50 HRS
    For any missing time greater than 30 calendar days, please complete a Salary Request for Labor Hours Transfer Form (SA8250).  If you have any questions, please contact Salary Timekeeping on extension 6-5571 or 6-5500.  
    <i>I want following Extra row to be added in when i send Emails to recipients.They should receive Date & Time when i sent that E-mail in following way.</i>
    <b>Sent: Monday, August 15, 2005 10:44 AM</b>
    Can any body help how can i solve this issue.
    Thanks in advance.
    Thanks & Regards,
    Rayeezuddin.

    Hi,
    check this link:
    http://www.sapdevelopment.co.uk/reporting/email/email_sapmail.htm
    It has options for date and time while sending a mail.
    Best Regards,
    Anjali

  • Regarding function module in update task

    Hi,
    I have a function module(Zxxx) which is update type. i have called the fun.module in my program (Zyyy) using the syntax CALL FUNCTION ZXXX IN UPDATE TASK. As I suppose to debug the function module, I activated the update debugging in the debugging screen. But the controll still not goen into the function module. Please let me know solution.
    Thanks & regards,
    Suresh

    >
    sureshkumar vaniyasekar wrote:
    > I activated the update debugging in the debugging screen. But the controll still not goen into the function module.
    Hello Suresh,
    What do you mean by not going?
    If you are trying to do an F5 at the function call, the debugger is not "enter" into the FM. This is because at this point the function call is registered but the FM is not executed.
    Update FM calls registered in a particular LUW are executed(in a special "UPD" workprocess) when there is a COMMIT encountered(may be explicit or implicit).
    Did you read the online help on [Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617d0ce68c11d2b2ab080009b43351/content.htm] & [Breakpoint behaviour during Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617cbee68c11d2b2ab080009b43351/content.htm]?
    BR,
    Suhas

  • Dought regarding Function module

    Hi ,
        I have small dought regarding fm....
    since  Read_text is a function module   can it be changed to RFC , since i need to retrive data from sap to informatica .
    since some of the long text are also need to retrived to a non sap system .
    if i creat a zread _text as a RFC .
    will this work  .am i in the right path ,need ur advice on the same .
    if its right what are the steps needs to be followed .to create a zread_text
    Thanks ,
    VInay .

    Create a new function module in SE37, e.g. Z_RFC_READ_TEXT and tick that it is RFC enabled.  The Import, Export, and Tables parameters should mirror those in READ_TEXT, but you might like to add another table so you can return any exception messages to the caller (e.g. "OT_RETURN" with a structure like BAPIRET2)... you might also have local standard for naming parameters in custom code which you may need to follow.  Inside your "Z" function module you just call 'READ_TEXT' using the parameters of the "Z" function.  Any exceptions from 'READ_TEXT' should be added into OT_RETURN so that the external caller can be advised of the problem.

  • Regarding Function module HR_MAINTAIN_MASTERDATA.

    hi experts,
    i have a requirement where in i need to inseert data in to infotype:0000,0001,0105,9010,0041  and update the infotypes:0015,0014,0008,0009 by using function module HR_MAINTAIN_MASTERDATA . i have used ACTIO as 'INS' and 'MOD' (since T589A table doesn't contain the 'UPD' operation).
    but using this "MOD' i am unable to update all the infotypes, instead it is throwing the error as entry doesn't exist in T589A for P.
    i need to know whether the following code is correct or not and also to overcome the error.. Please let me know the changes needed.
    DATA: BEGIN OF IT_INFTY,
              INFTY TYPE PPROP-INFTY,
            END OF IT_INFTY .
    DATA:  LV_PERNR          TYPE PSPAR-PERNR.
    LV_PERNR = '430102'.
    if ( IT_INFTY-infty = '0000' or IT_INFTY-infty = '0001'
              or  IT_INFTY-infty = '9010'
                or IT_INFTY-infty = '0105' OR IT_INFTY-infty = '0041' ).
        LV_OPERATION = 'INS'.
      elseif ( IT_INFTY-infty = '0007' or IT_INFTY-infty = '0008'
           or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
        LV_OPERATION = 'MOD'. 
      endif.
      CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
        EXPORTING
          NUMBER             = LV_PERNR  "WA_SOURCE_DATA-pernr
    IMPORTING
      RETURN             =
      LOCKING_USER       = sy-uname
      CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
       EXPORTING
         PERNR                    = LV_PERNR
      MASSN                    =
         ACTIO                    = LV_OPERATION        "'INS'
         TCLAS                    = 'A'
         BEGDA                    = SY-DATUM
         ENDDA                    = '99991231'
      OBJPS                    =
      SEQNR                    =
      SPRPS                    =
      SUBTY                    = lv_subty
      WERKS                    =
      PERSG                    =
      PERSK                    =
      PLANS                    =
         DIALOG_MODE              = '2'
      LUW_MODE                 = '1'
      NO_EXISTENCE_CHECK       = ' '
      NO_ENQUEUE               = ' '
       IMPORTING
         RETURN                   = RC
         RETURN1                  = RC1
      HR_RETURN                =
        TABLES
          PROPOSED_VALUES          = PROPOSED_VALUES
      MODIFIED_KEYS            =
      write : / rc-message.
      CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
        EXPORTING
          NUMBER = LV_PERNR  "WA_SOURCE_DATA-pernr
    IMPORTING
       RETURN        =
    kindly suggest.
    regards,
    joy.

    hi,
    i have a similar situation wherein i need to use the two operations insert and modifications for the infotypes.
    the problem i am facing is ,i need to put the logic in a method and it doesnt allow the usage of with header line. so how can we refer to the fields if the following logic is used.
    TYPES : begin of ty_infty,
                    infty TYPE pprop-infty,
                  END OF ty_infty.
    DATA: it_INFTY TYPE STANDARD TABLE OF TY_INFTY,
               proposed_values   TYPE  pprop occurs 0 with header line,
              wa_INFTY TYPE TY_INFTY.
    *************************updation of 0000***********************
    lv_fval = '01'.
      wa_proposed_values-infty = '0000'.
      wa_proposed_values-fname = 'P0000-MASSG'.
      wa_proposed_values-fval = LV_FVAL.
      wa_proposed_values-fname = '00'.
      append wa_proposed_values to proposed_values.
        it_infty-infty = wa_proposed_values-infty.
      clear wa_proposed_values.
    ***similarly we update the values for other infotypes
    if ( it_infty-infty = '0000' or it_infty-infty = '0001'
            or it_INFTY-infty = '0041' or it_INFTY-infty = '9010'
              or it_INFTY-infty = '0105').
        lv_operation = 'INS'.
      elseif ( it_INFTY-infty = '0007' or it_INFTY-infty = '0014' ).
            "or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
        lv_operation = 'MOD'.
      endif.
    CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
        EXPORTING
          NUMBER             = lv_pernr
    IMPORTING
      RETURN             =
      LOCKING_USER       = sy-uname
      CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
       EXPORTING
         PERNR                    = lv_pernr
      MASSN                    =
         ACTIO                    = lv_operation       
         TCLAS                    = 'A'
         BEGDA                    = SY-DATUM
         ENDDA                    = '99991231'
      OBJPS                    =
         DIALOG_MODE              = '2'
      LUW_MODE                 = '1'
      NO_EXISTENCE_CHECK       = ' '
      NO_ENQUEUE               = ' '
       IMPORTING
         RETURN                   = rc
         RETURN1                  = rc1
      HR_RETURN                =
        TABLES
          PROPOSED_VALUES          = proposed_values
      MODIFIED_KEYS            =
      write : / rc-message.
      CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
        EXPORTING
          NUMBER = lv_pernr
    IMPORTING
       RETURN        =
    here its giving an error that it_infty is a table without headerline and has no field as infty.
    how to over come this, please guide me in this regard. if this is not the correct logic please tell me the appropraite one..
    thanks in advance,
    Durga.

  • Regarding Function module call

    Hi Guru s
    Can any body explain  how many Function modules are stored in One function group.
         And What happen when I call 1 function module in a F.Group.
    Thanks in advance,
    Kumar.

    Hi,
    Function group can be defined it as collection of Function
    modules. This Function groups are presents in the Packages
    where we can create in the SE38. So,that all packages are
    consists in the Function Groups.All function groups are
    consists Function Modules.This function modules are created
    at enhancements/Exists.
    A function group can hav any no. of FM's.
    there is no restriction.
    reward if useful
    thanks and regards
    suma sailaja

  • Regarding function module to convert hours to minutes and seconds to minute

    hi all,
        is there any function module to convert hours to minutes and seconds to minutes....if so please guided me....i hav req like this...want to convert all those to minutes[seconds and hours]....

    Hi,
    Use FM
    SD_CALC_DURATION_FROM_DATETIME
    Pass paramters like
    I_DATE1 16.09.2008
    I_TIME1 10:33:00
    I_DATE2 16.09.2008
    I_TIME2 19:00:00
    and you will get the result as below..
    E_TDIFF 8:27
    8 hours and 27 minutes...
    Now u can use this values of hours and minutes to get the exact wage type values... get the details from HR module and multiply it with the hours and minute and calculate it...
    Use Offsets and get the hour and minute value from E_TDIFF
    Hope it will solve your problem..
    Thanks & Regards,
    Naresh

  • Regarding Function Module AC_DOCUMENT_RECORD

    Hi All,
    I am working on one Report in which I am calling the function module
    <b>AC_DOCUMENT_RECORD</b>. I am Exporting values for all the parameters to this function except
    I_AWSYS, I_AWTYP_INCL,I_AWTYP_EXCL.
    These parameters will be treated as Default to SPACE.
    Can anyone please tell me what these parameters are and what type of value or what value shall
    I Export to these Parameters.
    Regards,
    Rishi

    Dear Rishi,
    All these three parameters are optional. You can comment them if you do not want to pass any data. The system would treat them as SPACE.
    I_AWSYS -  Logical System (Character Type of Length 10: ACCHD-AWSYS)
    I_AWTYP_INCL - Reference procedure (Character Type of Length 5 :ACCHD-AWTYP)
    I_AWTYP_EXCL - Reference procedure (Character Type of Length 5 :ACCHD-AWTYP)
    Regards,
    Naveen.

  • Function Module (Execution)

    Hi All,
    Kindly help me out with the below scenario
    Scenario:
    1) I have to "CHEKIN" a file into DMS system using XI from file system, here DOC info is already present in the DMS system.Now only CHECKIN of file has to happen in correspond to particular DOCnum,DOCtype,DOCversion.
    2) To make it to work we use FM "BAPI_DOCUMENT_CHECKIN2"
    3) Now When i use this FM IN se38 and run it executes sucessfully by putting in the file ito DMS system,there is a paramter asking for file path : (We have given it the XI Server path)
    For instance : "
    xx.x.x.xxx\mdmtest\srinivas"
    3) Now i have imported this FM into XI and done mapping for these paramters , for some elements i have put conatnt mapping , for docpath etc.
    4) This is on Target (Receiver RFC Adapter) , but when i run the scenario, the Sender RFC is not picking up the same XI file path and putting it into DMS.
    Doubt:
    Target has : Element (Docpath) which is XI server path, will this work or donot work, suggest p.lz,When i run there is no error but file is not seen,
    Kindly revert back if there is no clarity.
    With regards
    Srinivas

    Hi,
    When i run the FM on the ERP backend system using se38 (ABAP Editor) , the function module has a parameter called "BAPI_DOCUMENT_CHECKIN2"
      lt_files-docfile  = for this parameter i have given
    local path of system             ( Ex: c:\temp\doc.txt )
    XI path folder                       ( Ex: '
    10.x.x.15x\mdmtest\srinivas\srinipaddu.txt' )
    ERP Backend system folder (Ex : '
    10.x.x.1x1\sapsdn\srinipaddu.txt'
    For Above three all are working fine when am executing from the SE38 of the system.
    But here in XI box i have used Receiver RFC Adapter and used 'BAPI_DOCUMENT_CHECKIN2" as target interface.Some fields are given constant value using mapping , for ex: "lt_files-docfile " but when i execute in XI there is no file checked in , it shows no error when i see in "Communication channel moniotring" in RWB , but in when i see in sxmb_moni of my target system there are no messages.
    i see no error , but my file in the specifed folder is not getting checked in .
    kindly put u r views seeing above steps done.
    thx in advnc
    srinivas

  • ABAP Programing help regarding function modules coding

    Hi,
    i'm currently creating a function module that retrieve a number from a table and add one to it and return back the value to the table.
    the codes are as follow:
    FUNCTION ZFM_NUMBER
    " * " Local Interface:
    " EXPORTING
    "      VALUE (ZZNUMBER) TYPE ZNUMBER
    "      VALUE (ZENUMBER) TYPE ZNUMBER
    SELECT ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    END SELECT.
    ZENUMBER = ZZNUMBER + 1.
    UPDATE ZTAB_NUM SET ZNUMBER = ZENUMBER WHERE ZNUMBER = ZZNUMBER.
    END FUNCTION.
    this function module works finely, but now i need to concatenate the number with the year to store it into another table.
    i know something about the sysdatum where i select only the first 4 characters...but i'm not sure how could i do that?
    do i need to create another function module to call the above function module and concatenate it with the year?
    or i just need to continue the codes in the same function module?
    and how should i code it?
    i'm very new to abap coding and i could'nt get help from anyone in my team. your help is very much appreciated!!!
    Thanks,
    leesyy

    hi you can do it in the same function module.
    SELECT ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    END SELECT.
    instead of the above statement use the following statement, it improves performance of your program
    SELECT single ZNUMBER FROM ZTAB_NUM into ZZNUMBER.
    in the above statement you can also specify some where condition
    ZENUMBER = ZZNUMBER + 1.
    UPDATE ZTAB_NUM SET ZNUMBER = ZENUMBER WHERE ZNUMBER = ZZNUMBER.
    data: var_date type sy-datum,
          var_yyyy(4) type c,
          var_numyear(10) type c.                   
    var_date = sy-datum.
    var_yyyy = var_date+0(4).
    concatenate ZENUMBER var_yyyy into var_numyear.
    UPDATE ZTAB_NUMyear SET ZNUMyear = var_numyear WHERE ZNUMBER = ZZNUMBER.
    Regards
    Sajid
    Edited by: shaik sajid on Jan 14, 2010 5:08 AM
    Edited by: shaik sajid on Jan 14, 2010 5:09 AM

  • Function Module Execution (ERP / SRM)

    Hi All,
    I have a RFC FM called "BAPI_DOCUMENT_CHECKIN2" on ERP back end System.
    I execute with below parameters :
    CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
    EXPORTING: documenttype = lf_doctype
    documentnumber = lf_docnumber
    documentpart = lf_docpart
    documentversion = lf_docversion
    hostname = ''
    statusintern = ''
    statusextern = lf_status
    statuslog = ''
    IMPORTING: return = ls_return
    TABLES: documentfiles = lt_files.
    I give parameters:
    lt_files-storagecategory = 'Z_xxxL_xxx'. "
    lt_files-docfile = '
    10.x.x.xxx\mdmtest\srinivas\srinipaddu.txt'.
    Now "srinipaddu.txt" gets attached in the DMS system (IP:10.x.x.xxx: Belongs to the XI box and not either backend erp or SRM box below)
    Second Scenario:
    Now this same FM which is not present in the SRM BOX is called up using below syntax (Destination)
    call function 'BAPI_DOCUMENT_CHECKIN2' DESTINATION 'abapdest' EXPORTING: documentnumber = lf_docnumber
    documenttype = lf_doctype
    documentpart = lf_docpart
    documentversion = lf_docversion
    hostname = ''
    statusintern = ''
    statusextern = lf_status
    statuslog = ''
    IMPORTING: return = pr_ls_return
    TABLES: documentfiles = pr_lt_files.
    Now the FM gets executed but the file in the specified folder is not getting attached in DMS system.
    Is this right or should i do any changes here
    help me out

    Hi,
           Try the function module GUI_RUN.
    Check this link.
    [http://abaplovers.blogspot.com/2008/05/sap-abap-function-module-to-run.html]
    Regards,
    Haritha.

  • Regarding Function Module for Locking ( enque)

    Hi,
    I am facing a Problem that is when iam running Call transaction one popup is coming because some other user currently editing that Tcode at that time i need to lock tcode using enque specially for table . If suppose some other user editing at that time it will shoe that popup and it will exit from their with out doing any other process For that i need Function module for Lock and Delock.
    thanks in advance,
    murali krishna.

    So in this example, I am doing a loop and check for a lock, if I don't get one, I wait for 5 seconds, this loop continues untill 30 seconds, no lock then it quits and gives message.
    report zrich_0001.
    data: counter type i.
    parameters: p_equnr type equi-equnr.
    start-of-selection.
      clear counter.
      do.
    Exhausted,  no luch in getting a lock, get of of DO loop.
        if counter > 6.
          sy-subrc = 1.
          exit.
        endif.
    Try for lock
        call function 'ENQUEUE_EIEQUI'
          exporting
            mode_equi            = 'E'
            mandt                = sy-mandt
            equnr                = p_equnr
       _wait                = 'X'
          exceptions
            foreign_lock         = 1
            system_failure       = 2
            others               = 3.
    Got a lock, get out of DO loop.
       if sy-subrc  = 0.
          exit.
        endif.
    Still here?  Then wait another 5 seconds
        wait up to 5 seconds.
        counter = counter  + 1.
      enddo.
    Report status
      case sy-subrc.
        when  0.
          message s001(00) with 'Lock could not be established'.
        when  1.
          message i001(00) with 'Lock could not be established'.
      endcase.
    Regards,
    rewards point

Maybe you are looking for