Problem when calling function module CV120_DOC_CHECKOUT_VIEW in background

Hi ,
I'm currently developping an abap program which extract document from KPRO for printing into a windows Folder.
For this I use standard function module CV120_DOC_CHECKOUT_VIEW.
When i run my program in foreground task there's no problem, but when i run it in background task the extract doesn't work. It seems that the system cannot connect to the Windows Network.
Whe the program is running in foreground task, the function module user SAPHHTP RFC destination, when it runs in background task it use SAPFTP destination .
Does somebody can help me ?
thanks in advance

Hi Ajay,
The program extract document into a folder on Windows Network that means on a server not on a PC .
I know that in background task ther's no connection with sapgui.
For example when i want to create a file on network n background task i use OPEN_DATASET instruction and that works fine.
My problem is the use of the standard function module CV120_DOC_CHECKOUT_VIEW in background task because when this function module is running in background task it use the SAPFTP rfc destination instead of SAPHHTP rfc destination in foreground task . I check the RFC destination , thoses works both . SO i think the problem comes from parameters given to the function module.
Regards.

Similar Messages

  • Error BT616 when calling function module SXPG_COMMAND_EXECUTE in background

    Hi All,
    We use function module SXPG_COMMAND_EXECUTE with a custom command we defined in SM69 to move files in unix (mv command).
    The function module call has worked fine for almost a year and recently we have been seeing an error (BT616) in our job lob (SM37) when the program is run in background. We have not been able to reproduce the error in foreground mode and it seems to be occuring only periodically in the background. (The appropriate SAP authorization objects where assigned to the batch job ID and the steps on the batch job.) We are in the process of setting up the trace flag and performing analysis on the trace log via ST11 to help identify the issue.
    After perform analysis on SXPG_COMMAND_EXECUTE, the error is occurring when calling function module SAPXPG_END_XPG for exception 2, system failure, yet function module SAPXPG_END_XPG does not exist. I assume this is a program at the operating system level and is just a signature of the parameters to be passed to the operating system program.
    Below is part of the SAP function module SXPG_COMMAND_EXECUTE that is failing.
    * Now we have to wait for the termination of the external
    * command if the caller wants us to.
        IF TERMINATIONWAIT = 'X'.
          CALL FUNCTION 'SAPXPG_END_XPG'
            DESTINATION DESTINATION
            IMPORTING   EXITSTAT = STATUS
                        EXITCODE = EXITCODE
            TABLES      LOG      = LOG
            EXCEPTIONS  COMMUNICATION_FAILURE = 1 MESSAGE MSG
                        SYSTEM_FAILURE        = 2 MESSAGE MSG.
    I performed a where used on function module SXPG_COMMAND_EXECUTE, and most of SAP programs call the function module with the parameter TERMINATIONWAIT = 'X', so I assume we should pass ‘X’ as well.
    Any ideas on what could be causing this issue?
    Mike Vondran

    I also remember I have this kind of issue, as I have some UNIX script at OS( UNIX) level . The problem was with the ID , as it don’t have proper authorization at OS level ( UNIX ) . Please check this ID authorization. This could be the one of reasons if you’re sure from SAP standpoint.
    Hope this’ll give you some guide line..
    Thanks
    Bye

  • Calling function module in the background task

    Hello everybody,
    I have a function module which wil create conditon records,the problem is it has performance problems because of which i am planning to make this as background job.
    Can any one of please tell me how the call function ' fun name ' in background task behaves.
    Regards,
    Aruna

    hi,
    try to refer to the link below:
    http://help.sap.com/saphelp_nw04/helpdata/EN/8f/53b67ad30be445b0ccc968d69bc6ff/content.htm
    i hope it helps
    regards
    arjun

  • ABAP Dump when calling Function Module Starting New Task

    Hi all. I have a tricky situation now, I am doing a POC on parallel processing.
    I am getting an ABAP dump on the following Call Function line which is in class lcl_steer_114numc (See below for full program):
    METHOD start.
        CALL FUNCTION 'Z_ZZCLS_STEER_114NUMC'
          STARTING NEW TASK me->id
          CALLING me->finish ON END OF TASK.
      ENDMETHOD.                    "start
    However I get the following ABAP dump:
    Short text
        Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK"
    The function module only contains a wait statement to simulate parallel processing. It is strange that it dumps here, because when I change the FM call to another call that has been triggered successfully from other classes, it still produces the same ABAP dump.
    The background of the Proof Of Concept is to see if I can get an event to trigger the next process that depends on the outcome of the previous process. Parallel processes are run in the start methods by calling RFC.
    <Garbled code removed>
    Moderator Message: Please post relevant portions of the code only.
    Edited by: Suhas Saha on Jul 17, 2011 1:17 PM

    Well, the thing is I did manage to run 3 other Function Modules asynchronously succeesfully prior to that function call, with the same exact function call syntax. Further more, I have tried editing it with your suggestion but I get the exact same dump.
    The complete function group can be downloaded here (slinkee file):
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZmFhNzcwMTgtYzQ0Mi00NzQ4LTg5YTMtNDNlNWUxYTM2NTg3&hl=en_US
    The complete program can be downloaded here (slinkee file):
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4YWJmNjU3ODYtODRmMy00Nzg2LThkNTUtZjNkNDRhZGQ3MTUw&hl=en_US
    The complete ST22 dump can be found here:
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZDU1YmFkZDAtOTU5MS00ZTgwLWFlZTktNWZhMDUxMzJlZWNl&hl=en_US
    Basically I ST22 gives me the following:
    Runtime Errors         RPERF_ILLEGAL_STATEMENT
    Date and Time          17.07.2011 05:29:54
    |Short text                                                                                |
    |    Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK"                 |
    |What happened?                                                                                |
    |    Error in the ABAP Application Program                                                         |
    |                                                                                |
    |    The current ABAP program "Z_ZZB1_CLOSE_PERIOD_TEST2" had to be terminated                     |
    |     because it has                                                                               |
    |    come across a statement that unfortunately cannot be executed.                                |
    And it explains it here (but is not helpful / relevant at all) as I ran the program from SE38.
    |Error analysis                                                                                |
    |    There is probably an error in the program                                                     |
    |    "Z_ZZB1_CLOSE_PERIOD_TEST2".                                                                  |
    |    The program was probably called in a conversion exit                                          |
    |    or in a field exit. These are implemented by                                                  |
    |    function modules called CONVERSION_EXIT_xxxxx_INPUT/OUTPUT or                                 |
    |    USER_EXIT_xxxxx_INPUT.                                                                        |
    |    Conversion exits are triggered during screen field transports or                              |
    |    WRITE statements, field exits during field transports from the                                |
    |    screen to the ABAP/4 program.                                                                 |
    |    In this connection, the following ABAP/4 statements are not allowed:                          |
    |                                                                                |
    I hope you try to download the slinkee files and you will notice the call function I performed was no different than the other call function RFC calls that really are working.

  • Problem when using function module : SO_NEW_DOCUMENT_SEND_API1

    hi,all 
    when i use this function module to send external email  ,a strange problem has been encountered. After executing this FM,i find that the return parameters SY-SUBRC = 0 . but when i use tcode SCOT to check the email in SAP email box,nothing has been found.
    could anyone please give me a clue about where the error occur ?

    you can try using commit work fter sy-subrc check.
    and also Try calling this Function module SO_DEQUEUE_UPDATE_LOCKS
    if sy-subrc eq 0.
    commit work.
    call function 'SO_DEQUEUE_UPDATE_LOCKS'.
    endif.

  • Problem when using function module PYXX_READ_PAYROLL_RESULT giving dump.

    When i am using PYXX_READ_PAYROLL_RESULT function module to get HR cluster data. I am getting following dump.
    So,can any one help me to solve this issue.I want this function data.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
      not caught in
    procedure "PYXX_READ_PAYROLL_RESULT" "(FUNCTION)", nor was it propagated by a
      RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    Call to FORM "IMPORT_RESULT" is incorrect:
    The actual parameter no. 2 has a different data type in the
    PERFORM than requested for the FORM "IMPORT_RESULT" in program "%_T0LJ20".
    Program                                 SAPLHRPAY99_IMPEXP
    Include                                 LHRPAY99_IMPEXPU02
    Row                                     1
    Module type                             (FUNCTION)
    Module Name                             PYXX_READ_PAYROLL_RESULT
    Program                                 SAPLHRPAY99_IMPEXP
    Include                                 LHRPAY99_IMPEXPU02
    Row                                     137
    Module type                             (FUNCTION)
    Module Name                             PYXX_READ_PAYROLL_RESULT

    Find below is my code can u tell me wch type is not true .i tried but not able to find prob solution.
    Plz help me waiting for reply.
    TYPE-POOLS: SLIS.
    DATA : FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          it_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout TYPE slis_layout_alv,
          gd_repid LIKE sy-repid,
          gt_events TYPE slis_t_event,
          gd_prntparams TYPE slis_print_alv,
          it_eve TYPE slis_t_event,
           V_LAYOUT  TYPE SLIS_LAYOUT_ALV.
          wa_eve TYPE slis_alv_event.
    *DATA header TYPE slis_t_listheader WITH HEADER LINE.
    *DATA: ls_fcat   TYPE slis_t_fieldcat_alv,
         l_lin     TYPE i.
    *DATA: ls_event TYPE slis_alv_event.
    DATA : WA_COLNO(2) TYPE N VALUE '1'.
    DATA : REPID LIKE SY-REPID.
    TABLES: PA0001,PA0002,T001P,T528T,T527X,T503T.
    DATA:BEGIN OF IT_PA0002 OCCURS 0,
          PERNR LIKE PA0002-PERNR,
         END OF IT_PA0002.
    DATA:BEGIN OF IT_PA0001 OCCURS 0,
          PERNR LIKE PA0001-PERNR,
          ENAME LIKE PA0001-ENAME,
          PLANS LIKE PA0001-PLANS,
          WERKS LIKE PA0001-WERKS,
          BTRTL LIKE PA0001-BTRTL,
          ORGEH LIKE PA0001-ORGEH,
          PERSK LIKE PA0001-PERSK,
         END OF IT_PA0001.
    DATA: BEGIN OF IT_T528T OCCURS 0,
            PLANS LIKE T528T-PLANS,
            PLSTX LIKE T528T-PLSTX,
          END OF IT_T528T.
    DATA: BEGIN OF IT_T001P OCCURS 0,
            WERKS LIKE T001P-WERKS,
            BTRTL LIKE T001P-BTRTL,
            BTEXT LIKE T001P-BTEXT,
          END OF IT_T001P.
    DATA: BEGIN OF IT_T527X OCCURS 0,
            ORGEH LIKE T527X-ORGEH,
            ORGTX LIKE T527X-ORGTX,
          END OF IT_T527X.
    DATA: BEGIN OF IT_T503T OCCURS 0,
            PERSK LIKE T503T-PERSK,
            PTEXT LIKE T503T-PTEXT,
          END OF IT_T503T.
    DATA:BEGIN OF IT_FINAL OCCURS 0,
          PERNR LIKE PA0001-PERNR,
          ENAME LIKE PA0001-ENAME,
          PLSTX LIKE T528T-PLSTX,
          BTEXT LIKE T001P-BTEXT,
          ORGTX LIKE T527X-ORGTX,
          PTEXT LIKE T503T-PTEXT,
         END OF IT_FINAL.
    *DATA: WI_RT LIKE LINE OF PAYROLL-INTER-RT,
    *DATA: WI_RGDIR LIKE STANDARD TABLE OF PC261 WITH HEADER LINE,
    DATA: IT_EVP TYPE HRPY_TT_RGDIR,
          ls_evp LIKE LINE OF IT_EVP,
          WI_RGDIR LIKE STANDARD TABLE OF PC261 WITH HEADER LINE,
          WI_PAYRESULT TYPE PAY99_RESULT.
         WI_PAYRESULT TYPE STANDARD TABLE OF PAYUS_RESULT WITH HEADER LINE.
    DATA  WG_MOLGA LIKE T500L-MOLGA.
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    SELECT-OPTIONS: S_PERNR FOR PA0001-PERNR,
                    S_BTRTL FOR PA0001-BTRTL,
                    S_ORGEH FOR PA0001-ORGEH.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM BUILD_FIELD_CATLOG.
      PERFORM DISPLAY_DATA.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA .
      SELECT PERNR
        INTO CORRESPONDING FIELDS OF TABLE IT_PA0002
        FROM PA0002
        WHERE PERNR IN S_PERNR.
      IF IT_PA0002[] IS NOT INITIAL.
        SELECT PERNR ENAME PLANS WERKS BTRTL ORGEH PERSK
           INTO CORRESPONDING FIELDS OF TABLE IT_PA0001
           FROM PA0001
           FOR ALL ENTRIES IN IT_PA0002
           WHERE PERNR  = IT_PA0002-PERNR
           AND   BTRTL IN S_BTRTL
           AND   ORGEH IN S_ORGEH.
      ENDIF.
      IF IT_PA0001[] IS NOT INITIAL.
        SELECT PLANS PLSTX
          INTO CORRESPONDING FIELDS OF TABLE IT_T528T
          FROM T528T
          FOR ALL ENTRIES IN IT_PA0001
          WHERE PLANS = IT_PA0001-PLANS
          AND   SPRSL = 'EN'.
        SELECT WERKS BTRTL BTEXT
          INTO CORRESPONDING FIELDS OF TABLE IT_T001P
          FROM T001P
          FOR ALL ENTRIES IN IT_PA0001
          WHERE WERKS = IT_PA0001-WERKS
          AND   BTRTL = IT_PA0001-BTRTL.
        SELECT ORGEH ORGTX
          INTO CORRESPONDING FIELDS OF TABLE IT_T527X
          FROM T527X
          FOR ALL ENTRIES IN IT_PA0001
          WHERE ORGEH = IT_PA0001-ORGEH
          AND   SPRSL = 'EN'.
        SELECT PERSK PTEXT
          INTO CORRESPONDING FIELDS OF TABLE IT_T503T
          FROM T503T
          FOR ALL ENTRIES IN IT_PA0001
          WHERE PERSK = IT_PA0001-PERSK
          AND   SPRSL = 'EN'.
      ENDIF.
    *DELETE ADJACENT DUPLICATES FROM IT_PA0001 COMPARING PERNR.
      LOOP AT IT_PA0001.
        MOVE IT_PA0001-ENAME TO IT_FINAL-ENAME.
        READ TABLE IT_PA0002 WITH KEY PERNR = IT_PA0001-PERNR.
        IF SY-SUBRC = 0.
          MOVE IT_PA0002-PERNR TO IT_FINAL-PERNR.
        ENDIF.
        READ TABLE IT_T528T WITH KEY PLANS = IT_PA0001-PLANS.
        IF SY-SUBRC = 0.
          MOVE IT_T528T-PLSTX TO IT_FINAL-PLSTX.
        ENDIF.
        LOOP AT IT_T001P WHERE WERKS = IT_PA0001-WERKS AND BTRTL = IT_PA0001-BTRTL.
          MOVE IT_T001P-BTEXT TO IT_FINAL-BTEXT.
        ENDLOOP.
        READ TABLE IT_T527X WITH KEY ORGEH = IT_PA0001-ORGEH.
        IF SY-SUBRC = '0'.
          MOVE IT_T527X-ORGTX TO IT_FINAL-ORGTX.
        ENDIF.
        READ TABLE IT_T503T WITH KEY PERSK = IT_PA0001-PERSK.
        IF SY-SUBRC = '0'.
          MOVE IT_T503T-PTEXT TO IT_FINAL-PTEXT.
        ENDIF.
        CALL FUNCTION 'CU_READ_RGDIR'
          EXPORTING
            PERSNR          = IT_FINAL-PERNR
          BUFFER
          NO_AUTHORITY_CHECK = ' '
          IMPORTING
            MOLGA           = WG_MOLGA
          TABLES
            IN_RGDIR        = WI_RGDIR
          EXCEPTIONS
            NO_RECORD_FOUND = 1
            OTHERS = 2 .
         CLEAR WG_SUM.
        LOOP AT WI_RGDIR INTO ls_evp.
           IF ( WI_RGDIR-FPEND BETWEEN P_STDATE AND P_ENDATE AND
           WI_RGDIR-SRTZA = 'A' ) .
             IF Wg_MOLGA = '10'.
          CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
            EXPORTING
              CLUSTERID                    = 'IN'
              EMPLOYEENUMBER               = IT_FINAL-PERNR
              SEQUENCENUMBER               = ls_evp-SEQNR
            READ_ONLY_INTERNATIONAL      = ''
            CHANGING
              PAYROLL_RESULT               = WI_PAYRESULT
            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.
             endif.
        ENDLOOP.
        APPEND IT_FINAL.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM IT_FINAL COMPARING ALL FIELDS.
    ENDFORM.                    " GET_DATA
    *&      Form  BUILD_FIELD_CATLOG
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_FIELD_CATLOG .
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'PERNR'.
      FIELDCATALOG-SELTEXT_M = 'Emp Code'.
      FIELDCATALOG-COL_POS = WA_COLNO.
      FIELDCATALOG-OUTPUTLEN = 9.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      WA_COLNO = WA_COLNO + 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ENAME'.
      FIELDCATALOG-SELTEXT_M = 'Emp Name'.
      FIELDCATALOG-COL_POS = WA_COLNO.
      FIELDCATALOG-OUTPUTLEN = 40.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      WA_COLNO = WA_COLNO + 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'PLSTX'.
      FIELDCATALOG-SELTEXT_M = 'Position'.
      FIELDCATALOG-COL_POS = WA_COLNO.
      FIELDCATALOG-OUTPUTLEN = 26.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      WA_COLNO = WA_COLNO + 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'BTEXT'.
      FIELDCATALOG-SELTEXT_M = 'Work Location'.
      FIELDCATALOG-COL_POS = WA_COLNO.
      FIELDCATALOG-OUTPUTLEN = 15.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      WA_COLNO = WA_COLNO + 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ORGTX'.
      FIELDCATALOG-SELTEXT_M = 'Dept. Description'.
      FIELDCATALOG-COL_POS = WA_COLNO.
      FIELDCATALOG-OUTPUTLEN = 25.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      WA_COLNO = WA_COLNO + 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'PTEXT'.
      FIELDCATALOG-SELTEXT_M = 'Grade Set Code'.
      FIELDCATALOG-COL_POS = WA_COLNO.
      FIELDCATALOG-OUTPUTLEN = 21.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      WA_COLNO = WA_COLNO + 1.
      APPEND FIELDCATALOG TO FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELD_CATLOG
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_DATA .
      REPID = SY-CPROG.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                =  REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            =  'TOP-OF-PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = 'ALV_BACKGROUND'
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         = 'X'
         IT_FIELDCAT                       = FIELDCATALOG[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = 'A'
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_FINAL
       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.
    ENDFORM.                    " DISPLAY_DATA

  • Problem in calling  function module CLVF_VB_INSERT_CLASSIFICATION'

    Hello every one
    I need to update the characteristic value of  material by calling a function module
    CLVF_VB_INSERT_CLASSIFICATION.
    but i dont know what parameters should be passed to it, please help me.
    thanking you all
    p.chitrakala

    See standard BAPIs to be used in thread Query on classification material characteristic values update/insert
    These BAPIs are said to be well documented. Ask your functional team if it's not clear.
    Advice: create characteristics manually as they should be created by bapis, then run the BAPI_..._GET_DETAIL bapis (you just need to know the key, that should not be too much complex I hope) to see what values are returned. You will use these values to fill in the exporting parameters of BAPI_..._CREATE or BAPI_..._CHANGE

  • How to capture errors when a Function module is called as BACKGROUND TASK

    How to capture errors when a Function module is called as BACKGROUND TASK?.Please advise.
    FUNCTION ZRPM_DELETE_PROJECT_DATA_API.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(IV_EXTERNAL_ID) TYPE  RPM_TV_EXTID OPTIONAL
    *"     VALUE(IV_PROJECT_GUID) TYPE  RPM_TV_GUID OPTIONAL
    *"     VALUE(FLAG) TYPE  BOOLEAN OPTIONAL
    *"  EXPORTING
    *"     VALUE(EV_RC) TYPE  I
    *"     VALUE(EV_MSG) TYPE  STRING
    *"     VALUE(ET_MSG) TYPE  RPM_TT_MESSAGES
      IF flag = cl_rpm_co=>sc_true.
        Call function 'RPM_DELETE_PROJECT_DATA' IN BACKGROUND TASK
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_RC
            ET_MSG          = ET_MSG.
        COMMIT WORK.
      ELSE.
        CALL FUNCTION 'RPM_DELETE_PROJECT_DATA'
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_MSG
            ET_MSG          = ET_MSG.
      ENDIF.
    ENDFUNCTION.
    In above code how to capture 'EV_RC' when FM is called as background task.

    Prakash,
    CALL FUNCTION IN BACKGROUND TASK allows no IMPORTING parameters, so that your code will produce a syntax error.
    The calling program can only handle errors of remote function calls (RFC) if these are either
    - synchronous RFC  (that is CALL FUNCTION ... DESTINATION ...) or
    - asynchronous RFC (that is CALL FUNCTION STARTING NEW TASK ... DESTINATION ...).
    Both synchronous and asynchronous RFC allow the capturing of errors by means of exceptions. But that is a different topic.

  • What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?

    Hi experts,
    I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
    1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
    2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
    3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
    Finally, thanks for reading and help.

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • Problem in calling application module's custom functions

    i m facing problem in calling application module's custom functions in jsp pages.
    i'll highly appreciate any reply to this mail.
    anant

    Hi,
    I also need to know how to call custom methods
    within an application module implementation.
    I have tried the <jbo:ApplicationModule id=am ...\>
    then later in the JSP <% am.customMethod() %>
    and this does not work. Any hints?I don't know how it works with JSPs, but if you want to call a custom method on a ApplicationModule, you first have to cast it to your custom class type.
    Somethin like this:
    MyAppModule am = (MyAppModule) sessionCookie.useApplicationModule( ... )
    or maybe in your JSP
    <jbo:ApplicationModule id="am">
    <% MyAppModuleClass am = (MyAppModuleClass) am; %>
    I think you forgot to do something like this in your JSP. Note that the code is not tested.
    Hope that helps
    Benjamin

  • Call Function Destination in a background job

    I am having a problem using:
      CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
             DESTINATION p_dest
    in a background job.
    I am working on a program that would compare the same table in 2 different systems and write the differences.  It works when I run it in the foreground.  However, I want to run this in a nightly background job.  However, it is failing and I beleive that it is the result of the program needing a user to interactively logon to the remote system.
    How can I bypass the logon screen or enter information into the logon screen using a background job?
    Thanks.
    Jon

    Hi Jonathan,
    Would you like to reward some points to the poster to thank them as a part of SDN Contributor Recognition Program?
    You can click on the yellow star on the right of each post header to reward points.
    For more information:
    https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    John.

  • Uncatchable exception: BSP calling Function Module

    Hi all,
    currently i'm facing a very weird problem. My application class calls function module
    HR_INFOTYPE_OPERATION. Normally, in case of an error, the function module gives you back a return parameter. But if i call it from my BSP, the processing doesn't leave the function module. It directly throws an exception ERROR_MESSAGE_STATE instead of writing the message into parameter return.
    If i call the function module with the same parameters from a report, it works fine and the error message is written to return parameter without throwing an exception.
    What am i doing wrong? I don't want that exception and need to go on with filled parameter result.
    Regards
    Mark-André

    Hi MA,
    try using ERROR_MESSAGE in the exceptions list, like this.
    CALL FUNCTION 'func_name'
         EXPORTING
              string            = text
              pos               = position
         IMPORTING
              string1           = text1
              string2           = text2
         EXCEPTIONS
              string1_too_small = 1
              string2_too_small = 2
              ERROR_MESSAGE     = 3
              OTHERS            = 4.
    Cheers
    Graham Robbo

  • Problem in  using function module parameters in abap program

    i want to use the coding present in on one of the function module 'AS_API_INFOSTRUC_FIND'  i got the problem using the function module parameters in my abap program.
    these are the parameters inside fm
    ""Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(I_FIELDCAT) TYPE  AIND_FCAT
    *"             VALUE(I_FIELDS) TYPE  TABLE OPTIONAL
    *"             VALUE(I_OBLIGATORY_FIELDS) TYPE  TABLE OPTIONAL
    *"       EXPORTING
    *"             VALUE(E_INFOSTRUC) TYPE  AIND_DESC
    *"             REFERENCE(E_ALL_FIELDS) TYPE  TABLE
    *"             REFERENCE(E_MATCHING_FIELDS) TYPE  TABLE
    *"       EXCEPTIONS
    *"              NO_INFOSTRUC_FOUND
    i want to declare     E_ALL_FIELDS  parameter    in my abap program,
    i have declared as 
    data: E_ALL_FIELDS TYPE TABLE.
    but   the system throws error that
    'type of field 'TABLE'  is generic .no table line has been specified'.
    i want to use it in my abap program how can i declare in my abap program .

    You have to declare the table using any specific type.
    The type table in the FM is generic so you can pass any type you need.
    For instance:
    TYPES: BEGIN OF ty_fields,
             fieldname LIKE dfies-fieldname,
           END OF ty_fields,
    TYPES: TY_T_GLU1              LIKE GLU1                     OCCURS 0,
           ty_t_fields            type ty_fields                occurs 0.
      DATA: lt_info_struct_fields TYPE ty_t_fields WITH HEADER LINE,
            lt_matching_fields    TYPE ty_t_fields WITH HEADER LINE.
        CALL FUNCTION 'AS_API_INFOSTRUC_FIND'
             EXPORTING
                  i_fieldcat         = ft_fieldcat-fieldcat
                  i_fields           = ft_fields_filled[]
             IMPORTING
                  e_infostruc        = lv_info_struct_name
                  e_all_fields       = lt_info_struct_fields[]
                  e_matching_fields  = lt_matching_fields[]
             EXCEPTIONS
                  no_infostruc_found = 1.

  • How to DEBUG a function module running in background mode? Please help!

    Hi Experts,
       I am calling a function module in my ABAP code in background module using the following syntax:
      CALL FUNCTION 'YBBC2_CREATE_SNAPSHOT' IN BACKGROUND TASK
              TABLES
                itab_std_format_inv = itab_std_format_inv
                itab_snapshot_inv = itab_snapshot_inv.
            COMMIT WORK.
    If I put the breakpoint in the CALL FUNCTION line and execute the program, the debugger does not take me to the valled function module. This may be because I am running the function module as background task.
    I cannot comment this  "IN BACKGROUND TASK" statement as well since i am debugging in Quality system where I don't have change access.
    So how to DEBUG a function module running in background mode? Please help!
    Thanks
    Gopal

    Hi,
    You could try to use the following trick:
    (1) Put an endless loop into the coding of your function module where you want to start debugging, e.g.
      DATA:
        lx_exit_loop(1)     TYPE c.
      lx_exit_loop = ' '.
      DO.
        IF ( lx_exit_loop = 'X' ).
          EXIT.
        ENDIF.
      ENDDO.
    (2) Call your function module in background task
    (3) Call transaction SM50 and search for the background process.
    (3) Choose from menu Program/Mode -> Program -> Debugging
    Now you the debugger should bring you right to your endless loop. Set lx_loop_exit = 'X' in the debugger and continue (F5 or F6).
    <b>Reward points</b>
    Regards

  • Calling Function Module in Update Task

    Hello Experts,
                              Can anyone let me know about
    Calling Function Module in Update Task.
    Why do we use this " In Update Task "  ??
    How do we Use ??
    What is the Use... ??
    Kindly let me know....
    Thanks and Regards
    Pramod

    hi,
    Why do we use this " In Update Task " ??
    The main update technique for bundling database changes in a single database LUW is to use CALL FUNCTION... IN UPDATE TASK.
    How do we Use ??
    A typical R/3 installation contains dialog work processes and at least one update work process. The update work processes are responsible for updating the database. When an ABAP program reaches a COMMIT WORK statement, any function modules from CALL FUNCTION... IN UPDATE TASK statements are released for processing in an update work process. The dialog process does not wait for the update to finish. This kind of update is called asynchronous update.
    What is the Use... ??
    Asynchronous update is useful when response time from the transaction is critical, and the database updates themselves are so complex that they justify the extra system load
    Real time scenario.
    Suppose a user wants to change an entry in a database table, or add a new one. He or she enters the necessary data, and then starts the update process by choosing Save. This starts the following procedure in the ABAP program:
    Firstly, the program locks the database entry against other users, using the enqueue work process (or the message server in the case of a distributed system). This generates an entry in the lock table. The user is informed whether the update was successful, or whether the lock could not be set because of other users.
    If the lock is set, the program reads the entry that is to be changed and modifies it. If the user has created a new entry, the program checks whether a record with the same key values already exists.
    In the current dialog work process, the program calls a function module using CALL FUNCTION... IN UPDATE TASK, and this writes the change details as an entry in table VBLOG.
    When the program is finished (maybe after further dialog steps), a COMMIT WORK statement starts the final part of the SAP LUW. The work process that is processing the current dialog step starts an update work process.
    Based on the information passed to it from the dialog work process, the update work process reads the log entries belonging to the SAP LUW from table VBLOG.
    The update work process passes this data to the database for updating, and analyzes the return message from the database. If the update was successful, the update work process triggers a database commit after the last database change and deletes the log entries from table VBLOG.
    If an error occurred, the update work process triggers a database rollback, leaves the log entries in table VBLOG, flags them as containing errors, and sends a SAPoffice message to the user, who should then inform the system administrator.
    The corresponding entries in the lock table are reset by the update work process.
    Hope this is helpful, Do reward.

Maybe you are looking for

  • Importing music and video through command line

    I can't seem to get the following to work at the DOS prompt (W2000)- C:\"Program Files"\iTunes\iTunes.exe "C:\TEMP_MEDIA" I am running iTunes 7.0.2.16. iTunes launches with the above, but the files are not imported into iTunes from the directory. The

  • N73ME Media Transfer mode problem

    I am able to use my N73 in pc suite & mass storage mode but not in media player mode... although on connecting in the media player mode....phone goes in offline mode & media transfer connection is shown active (with bar always active & horizontally m

  • User of TCS- getting error when launching Captivate

    I am a TCS user, which comes with Captivate. I have been using FM and RoboHelp for sometime now... and now we want to start using Captivate. When I go to launch Captivate off my start menu, I am unable to do so- I get this error: "This Product is alr

  • RMAN clone query

    Hello DBA's I'm using an 9i Oracle Solaris box. I have a task to clone a TEST enviornment into a existing TRAIN enviornment using RMAN. I edited the TEST spfile and ran the RMAN duplicate commnad - 'duplicate target database to train;' without deleti

  • Traffic Light CLD Critique please

    Have at it. Go ahead be harsh. There may be some extra junk in the project I didn't clean up like some subVIs I ended up not using or elements in my cluster I didn't use, so feel free to ignore those CLA, LabVIEW Versions 2010-2013 Attachments: traff