HR ABAP Doubt

Hi,
I have two pieces of code and i thought they will do the same , but they have different outputs. Please let me know why i get different outputs.
code 1:
REPORT  ZBALAHRTEST.
data i type i.
nodes pernr.
INFOTYPES : 0000,0001,0002,0003,0004,0005,0006,0007.
get pernr.
if p0001-pernr = '0000001'.
   write : p0001-begda , p0001-endda. 
endif.
Output:
23.09.2008 31.12.9999
The second code.
REPORT  ZBALAHRTEST1.
tables pa0001.
SELECT * from pa0001 where pernr = '00000001'.
  write :/, pa0001-begda,pa0001-endda.
ENDSELECT.
Output:
01.06.2008 22.09.2008
23.09.2008 31.12.9999
does this mean get pernr retrieves only the latest record from the infotype.
Kindly help gurus.
Thanks in advance,
Bala

>
Bala Shanmuga Priyan wrote:
> Hi,
>
> I have two pieces of code and i thought they will do the same , but they have different outputs. Please let me know why i get different outputs.
>
> code 1:
>
>
>
REPORT  ZBALAHRTEST.
> data i type i.
> nodes pernr.
> INFOTYPES : 0000,0001,0002,0003,0004,0005,0006,0007.
>
> get pernr.
>
> if p0001-pernr = '0000001'.
>    write : p0001-begda , p0001-endda. 
> endif.
>
> Output:
> 23.09.2008 31.12.9999
>
>
> The second code.
>
>
REPORT  ZBALAHRTEST1.
>
> tables pa0001.
>
> SELECT * from pa0001 where pernr = '00000001'.
>   write :/, pa0001-begda,pa0001-endda.
> ENDSELECT.
>
> Output:
>
>
> 01.06.2008 22.09.2008
>
> 23.09.2008 31.12.9999
>
> does this mean get pernr retrieves only the latest record from the infotype.
>
> Kindly help gurus.
>
> Thanks in advance,
> Bala
data i type i.
nodes pernr.
INFOTYPES : 0000,0001,0002,0003,0004,0005,0006,0007.
  get pernr.
     LOOP AT p0001.
       write:/  p0001-begda , p0001-endda.
     ENDLOOP.
make this above change to your first code and check the results
the LDB populates the table P0001 with all the records of PA0001

Similar Messages

  • ABAP doubts/questions in developing Cusotmer Exit

    Hi,
    I found a customer exit for variables in one of the SDN docs and I have few ABAP questions in it. Function exit is EXIT_SAPLRRS0_001 and Include ZXRSU01. I would really appreciate if someone can help me with it.
    1.     What exactly is an Include? As in this case ZXRSU01?
    2.     What is the difference in the declaration DATA: xyz type d and DATA: xyz like ..
    3.     I have two declarations in a user exit DATA: L_S_RANGE TYPE RSSR SRANGESID and LOC_VAR_RANGE LIKE RRRANGEEXIT. What does RSSR SRANGESID and RRRANGEEXIT correspond to?
    4.     What is I_STEP, there is a statement which says I_STEP=2. What are the all the possible values for I_STEP. As in 2 here is after the popup.
    5.     Also what exactly is I_STEP?
    6.     What does I_VNAM and I_T_VAR_RANGE correspond to? (If I am not wrong it corresponds to variable name)
    7.     From where can I get a list of all such standard variables like I_STEP, I_VNAM…
    Thank you,
    sam

    Your explanation is good. But right now I am working developing a customer exit for BEx variable. Can you please explain questions above in context to the code below:
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
    Data: v_loc_date type d.
    Data: v_loc_date1 type d.
    Data: v_loc(4) type c.
    CASE I_VNAM.
    to calculate "month to date" user input is "Calday" Key Date
    WHEN 'ZPUTMNTH'.
    IF I_STEP = 2. "after the popup
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZPDATE'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(6). "low value, e.g.YYYYMM (200606) part of key date (20060625)
    L_S_RANGE-LOW+6(2) = '01'. “ low value e..g. YYYYMM01 (20060601)
    L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "high value = input
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    ENDIF.
    Thank you,
    sam

  • Basic ABAP doubts

    Hi Experts,
    got some basic doubts..hope ppl can help me tackle them..
    1. y is sapscript client-specific when smartforms are     cross-client ?
    2. why exactly are reference fields required for Currency n Quantity Fields ?
    3. In SE93, while creating a transaction for an executable program, no variant comes in F4 even wen we have created one for the program, n wen we type in the variant, it says the Transaction is inconsistent.. is it because transaction is cross-client whereas variant is not ??
    4. where is DDIC placed?? i mean is it in database or Application server ?
    5. why do we need to have a Value table ?
    Please dont copy & paste from existing sources..it wud be great if u cud explain in ur own wrds...
    all answers wud be appropriately rewarded..
    thanks.
    bikash

    thanks for the reply guys..
    Andreas,it wud ve been better if u explain ur answers.
    pawan.
    1. smartform when activated generates a function module which becomes part of DDIC. so client-independent ... ( arent transparent tables part of DDIC ??? they are client-dependent though )...
    2. bcoz when u say amounts like 1000 rupees, 1000 refers to amount and rupees refers to currency unit.
    thats ok pawan, but how does it matter if it is rupees or USD or EURO..its anyway a field with lets say 13 digits n 2 decimals..n also the field contains only 1000, not the rupees, that part anyway can be got from the currency field.....
    3. did u test in a multiple-client system?? ie, it comes in IDES over here too, i think dats because IDES doesnt have multiple client..
      Also, if it has come in a multiple client system, wat ll happen if u run that transaction in a client in which that variant is not there..it ll throw an error right??
    4. wat my doubt is that anything that is there, also the definitions has to be stored someweher right?? so isnt the database where everything including the dictionary is stored??
    awaiting ur useful responses...
    Message was edited by: Bikash  Agarwal

  • HR ABAP doubts

    Hii All-
    I have a requirement to fetch all the full time/part time active employees from the start date of the reporting period. The report must be able to be run for past and future periods and only include the active employees based on the start date selected.
    In the above scenario, should I have to use RP-PROVIDE-FROM-LAST  OR use PROVIDE-ENDPROVIDE to fetch the data from INfo types??
    Another question is, what report category should I have to use here? How can I assign report category to the report??
    I shall reward the helpful answers.
    Tx

    Hi Shakir,
       First of all you have to assign logical database name say PNP in the attributes of the program. After assigning the logical data base, you can see teh button below with HR REPORT CATEGORY. Click on that and select Master dat(infotypes) radio button. After that go for f4 help to see the existed HR report categories. From that you select one which contains the fields you want. If you are not able to find Hr report category with the fields you want then you need to create your own report category with the fields you want.
    If you want to select only active employees
    RP-PROVIDE-FROM-LAST p0000 space pn-begda pn-endda.
    CHECK P0000-STAT2 = '3'.
    note: '3' or some other value based on the values stored in infotype 0000 for the employment status.
    if employee is not active then it will skip that employee and selects the next employee.

  • Abap doubt

    hi this is satish,
        how to change the date formate in the alv report.Actually the values are coming from the table.In the table the date format be yyyymmdd.but How to change the date formate in alv like ddmmyyyyy.Any one can send the code to change that format

    Hi..
    Try this code ,i had hardcode the date in yyyymmdd format but the output is coming in ddmmyyyy format itself..
    REPORT  ZBA_ALV.
    type-pools slis.
    data : begin of itab occurs 0,
           date type d ,
           end of itab,
           it_fieldcat type slis_t_fieldcat_alv,
           wa_fieldcat type slis_fieldcat_alv.
    start-of-selection.
           itab-date = '20071121'.
           append itab.
       wa_fieldcat-fieldname = 'DATE'.
       append wa_fieldcat to it_fieldcat.
           CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
            EXPORTING
              I_CALLBACK_PROGRAM             = sy-repid
              IT_FIELDCAT                    = it_fieldcat
             TABLES
               t_outtab                       = itab.
    Post for further queries.
    Regards
    Bala.

  • Abap doubt basic

    wat is the diff between SE18 vs SE19

    Hi Kiran kumar,
      By using SE18---> Testing can be done.
                    SE19----> Testing cannot be done.
    Hope I am clear.
    Please let me know if you have any queries..!
    Thanks and Regards,
    Chandu.

  • Abap doubts

    hi,
      pls answer these questions.
    1. How do u check data consistency in BDC?
    2. what exactly difference between header data(VBAK) , item data(VBAP) and shedule data( VBEP).
    3. functional flow of MM? with transaction codes?
                                         regards, 
                                                chandra babu

    Chandra,
    1. How do u check data consistency in BDC?
        Can you explain a little more.
    2. what exactly difference between header data(VBAK) , item data(VBAP) and shedule data( VBEP).
        The data of a sales document is divided. Header data consists of details like Customer number, doc date etc. Item details are the material details that you are selling. Schedule data will contain the details of date on which you are going to deliver the goods.
    3. functional flow of MM? with transaction codes?
       Create a RFQ / Quotation.
       Purchase Req  - ME51n / ME52n / ME53n
       Release Purchase Req.
       Purchase Order - ME21n / 22n / 23n (Create with Ref to Prucahse Req or Quotation)
       Delivery / Goods Issue - MIGO
       Invoice - MIRO
    Please reward the helpful answers
    Regards,
    Ravi

  • Regarding.SAP-ABAP

    hi experts,
    I would like to know the SAP-ABAP real time scenarios on topic vise.Can anybody will explain or give some real time examples?
    Waiting for your reply....

    Hi
    Just try to utilize as most as this site sdn.sap.com for your ABAP doubts.
    Few more sites also available for developing your skills.
    www.help.sap.com
    www.sapdevelopment.co.uk
    www.planetsap.com
    www.sapbrainsonline.com
    www.erpgenie.com
    www.ittoolbox.com
    The last two sites will be more usefull for interview questions.
    www.sap-img.com
    www.pdftutorials.com
    www.abapcode.blogspot.com
    Use these links to get more ideas about the ABAP.
    You have to search module by module use these links.
    Go for Siemens material. Check the following link:
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/ABAP_tutorial.html
    very basics
    LINK : http://sapabap.iespana.es/sapabap/manuales/learnabap/
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    check with this following link
    it is having very good documentation
    http://www.sappoint.com/abap.html
    few more links...
    http://cma.zdnet.com/book/abap/index.htm
    http://www.sapdevelopment.co.uk/
    http://www.sap-img.com/
    http://juliet.stfx.ca/people/fac/infosys/abap.htm
    http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/en/d6/0db357494511d182b70000e829fbfe/frameset.htm
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://www.sapgenie.com/abap/example_code.htm
    http://www.geocities.com/SiliconValley/Campus/6345/abapindx.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://www.sap-img.com/abap-function.htm
    http://www.sapgenie.com/abap/code/abap19.htm
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://help.sap.com/saphelp_40b/helpdata/ru/d6/0dc169494511d182b70000e829fbfe/applet.htm
    http://www.henrikfrank.dk/abapexamples/SapScript/symbols.htm
    http://www.henrikfrank.dk/abapexamples/index.html
    http://sap.ittoolbox.com/documents/document.asp?i=752
    http://members.aol.com/_ht_a/skarkada/sap/
    http://sappoint.com/abap/
    http://members.tripod.com/abap4/SAP_Functions.html
    http://members.ozemail.com.au/~anmari/sap/index.html
    http://www.planetsap.com/Userexit_List.htm
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://www.kabai.com/abaps/q.htm
    http://www.planetsap.com/Userexit_List.htm
    http://help.sap.com/saphelp_bw21c/helpdata/en/c4/3a8090505211d189550000e829fbbd/frameset.htm
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/saphelp_45b/helpdata/en/65/897415dc4ad111950d0060b03c6b76/content.htm
    http://www.sap-basis-abap.com/index.htm
    http://help.sap.com/saphelp_40b/helpdata/en/fc/eb2c46358411d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/en/aa/aeb23789e95378e10000009b38f8cf/frameset.htm
    http://www.geocities.com/ResearchTriangle/1635/system.html
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • Can sorting facilty in internal tables can be used on char fields?

    Can sorting facilty in internal tables can be used on char fields?

    there is no restriction to sort by any TYPE. u ve the freedom to sort on any TYPE of fields.
    sort itab by ascending / descending F1 F2 F2.
    abap doubts, i request you to try and practise your doubts befor posting here in forums. I can understand you are a buddy.Please remember, PRACTISE MAKES MAN PERFECT. Try to master on own and approch forum in worst case.
    Also award points to all helpful answers.
    All the Best
    Thanks & Best Regards
    Kiran

  • Doubts in ABAP WebDynpro

    Hi Experts,
    I am new to ABAP WebDynpro and self-learning going through SDN stuff and other online-help. Please provide me
    your kind explanation on below doubts.
    1. When do we use GET_ATTRIBUTE and GET_STATIC_ATTRIBUTE
    2. How to read the index of a particular selected row in table?
    3. How do you change position of a particulr node dynamically?
    4. Is it possible to execute a component without a window?
    5. Is it possible to run a VIEW without embeding into a window in Webdynpro application?
    6. How to read the content entered in PARAMTER and SELECT-OPTION elements in ABAP Webdynpro? Can anybody pass code how to read entries?
    I mean GET_ATTRIBUTE or GET_STATIC_ATTRIBUTES is used for reading attribute value. 
    7. Is it possible to fix the Message window position? Show at the bottom of a screen? Please provide some code for this.
    8. Is it possible to change the color of a laber attached to a attribute dynamically? For example somefield is mandatory but you forgot to enter and press on u2018Continueu2019 then program should show that elementu2019s lable with redcolor text. Please provide me example code.
    Thanks in advance for the support and useful explanation!
    Regards,
    Meera.

    Hi
    Refer the answers inline
    1) When do we use GET_ATTRIBUTE and GET_STATIC_ATTRIBUTE
    GET_ATTRIBUTE
    Method to get the values of a context attribute.
    The prerequisite for this method is that the application knows the data type of the attribute.
    The value of the given attribute is copied to the export parameter. To do this the export parameter must have a data type to which a value can be written.
    GET_STATIC_ATTRIBUTES
    This method copies the static attributes to the transferred variable. If the structure is not identical, a move-correspondingis performed, which is not as efficient as a direct move, but is still useful in many cases.
    Static attributes are those that either have been declared or that belong to the structure with which the node was declared.
    2) How to read the index of a particular selected row in table?
    data: lr_element type ref to if_wd_context_element,
              lv_index type i.
      lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
      lv_index = lr_element->get_index( ).
    3) How do you change position of a particulr node dynamically?
        Explain Bit deeply
    4) Is it possible to execute a component without a window?
        No it is not possible, actually the component view can be viewed by embedding it to the window
    5) Is it possible to run a VIEW without embeding into a window in Webdynpro application?
        No it is not possible, without window you cant run the view
    6) Is it possible to run a VIEW without embeding into a window in Webdynpro application?
      DATA LO_ND_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA LO_EL_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
      DATA LS_MAIN_NODE TYPE WD_THIS->ELEMENT_MAIN_NODE.
      DATA LV_INP_VALUE LIKE LS_MAIN_NODE-INP_VALUE.
    navigate from <CONTEXT> to <MAIN_NODE> via lead selection
      LO_ND_MAIN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = 'MAIN_NODE' ).
    get element via lead selection
      LO_EL_MAIN_NODE = LO_ND_MAIN_NODE->GET_ELEMENT(  ).
    get single attribute
      LO_EL_MAIN_NODE->GET_ATTRIBUTE(
        EXPORTING
          NAME =  `INPUT_VALUE`
        IMPORTING
          VALUE = LV_INP_VALUE ).
    7) Is it possible to fix the Message window position? Show at the bottom of a screen?
        Yes it is possible to show the messages by using the message area UI element in the needed position
    8. Is it possible to change the color of a laber attached to a attribute dynamically? For example somefield is mandatory but you      forgot to enter and press on u2018Continueu2019 then program should show that elementu2019s lable with redcolor text.
        Im working onit and let you know after i complete.
    Regards
    Arun.P

  • ABAP HR DOUBTS

    Hi ,
      I have some doubts  in ABAP-HR.Please clarify my doubts.
    1) Provide and end provide statements are obsolate.Shall we use select in place of provide and provide?.
    2) what are the important macros in ABAP HR?
    3)Do we have to use logical data base if we are using macros?.
    Moderator message: please do not ask interview-type questions, search for available information.
    Edited by: Thomas Zloch on Jan 6, 2011 10:57 AM

    Hi Shakir,
       First of all you have to assign logical database name say PNP in the attributes of the program. After assigning the logical data base, you can see teh button below with HR REPORT CATEGORY. Click on that and select Master dat(infotypes) radio button. After that go for f4 help to see the existed HR report categories. From that you select one which contains the fields you want. If you are not able to find Hr report category with the fields you want then you need to create your own report category with the fields you want.
    If you want to select only active employees
    RP-PROVIDE-FROM-LAST p0000 space pn-begda pn-endda.
    CHECK P0000-STAT2 = '3'.
    note: '3' or some other value based on the values stored in infotype 0000 for the employment status.
    if employee is not active then it will skip that employee and selects the next employee.

  • ABAP Mapping doubt

    Hi.
    I'm trying to do an abap mapping. I've read weblogs from Robert Eijpe. The samples contained in the weblog worked fine but i have a doubt.
    ABAP class had a parameter called SOURCE. This parameter contains the XML but i think is contained in only one line. In the sample weblog, the XML is contained in an internal table.
    Question is ... how can i transform this SOURCE of 1 line into an internal table?
    Thanks.

    Hi Inigo,
    Please look at this..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/frameset.htm
    Hope it helps you!
    cheers,
    Prashanth

  • Doubt in ABAP function

    Hi,
    I have a doubt in one of the abap function module i use.
    This contain code to retrieve ,update and delete and create values in table. I am using this function  module to
    retrieve ,update and delete and create values in table.  This is the ABAP code.
    FUNCTION ZUP_DESIG12.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(DESG_CODE) TYPE  ZUP_DESIG-DESG_CODE OPTIONAL
    *"     VALUE(DESG_DESC) TYPE  ZUP_DESIG-DESG_DESC OPTIONAL
    *"     VALUE(DESG_ACT) TYPE  ZUP_DESIG-DESG_ACT OPTIONAL
    *"     VALUE(DESG_OPT) TYPE  ZUP_DESIG-DESG_OPT OPTIONAL
    *"  EXPORTING
    *"     VALUE(DESG_CODE_C) TYPE  ZUP_DESIG-DESG_CODE
    *"     VALUE(DESG_DESC_C) TYPE  ZUP_DESIG-DESG_DESC
    *"     VALUE(DESG_ACT_C) TYPE  ZUP_DESIG-DESG_ACT
    *"     VALUE(DESG_OPT_C) TYPE  ZUP_DESIG-DESG_OPT
    *"  TABLES
    *"      WA STRUCTURE  ZMSTR_DESIG
    DATA CNT TYPE I.
    SELECT MANDT DESG_CODE DESG_DESC DESG_ACT FROM ZMSTR_DESIG
      INTO TABLE WA.
    IF DESG_OPT = 'U'.
    UPDATE ZMSTR_DESIG
        SET DESG_DESC = DESG_DESC
        DESG_ACT = DESG_ACT
        WHERE DESG_CODE = DESG_CODE.
    MESSAGE 'Updated Successfully' TYPE 'I'.
    ELSEIF DESG_OPT = 'C'.
    SELECT COUNT( * ) FROM ZMSTR_DESIG INTO CNT
       WHERE DESG_CODE = DESG_CODE.
       IF CNT > 0.
       MESSAGE 'Duplicate Designation code' TYPE 'I'.
       ELSE.
      WA-DESG_CODE = DESG_CODE.
      WA-DESG_DESC = DESG_DESC.
      WA-DESG_ACT = DESG_ACT.
      MODIFY ZMSTR_DESIG FROM WA.
       MESSAGE 'Inserted successfully' TYPE 'I'.
    ENDIF.
    ELSEIF DESG_OPT = 'D'.
       DELETE FROM ZMSTR_DESIG WHERE DESG_CODE = DESG_CODE.
       MESSAGE 'Deleted successfully' TYPE 'I'.
    ENDIF.
    ENDFUNCTION.
    can any one what is  wrong in this function.
    Regards,
    H.V.Swathi

    My doubt is how to write code to insert data to table. I have written code like this.
    try{
             String str1= wdContext.currentTestElement().getCode();
              String str2= wdContext.currentTestElement().getDesc();
              boolean str3= wdContext.currentTestElement().getAct();
              String str4= wdContext.currentTestElement().getOpt();
              String str5;
              if(str3)
              str5=new String("x");
              else
              str5=new String(" ");
              Zup_Desig12_Input input=new Zup_Desig12_Input();
              input.setDesg_Code(str1);
              input.setDesg_Desc(str2);
              input.setDesg_Act(str5);
              input.setDesg_Opt(str4);
              wdContext.nodeZup_Desig12_Input().bind(input);
              wdContext.currentZup_Desig12_InputElement().modelObject().execute();
        }catch(Exception e)
             wdComponentAPI.getMessageManager().reportSuccess(e.toString());
    But i am getting      java.lang.ArrayIndexOutOfBoundsException: -1
    in line
    input.setDesg_Act(str5);
    can any one help me plz

  • ABAP OO Doubt - validate call method.

    Hi experts
    I'm beginer in ABAP OO and i created this code :
    output-cep = ch_adrc_struc-post_code1.
                 TRY.
                     CREATE OBJECT lr_cep.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
                 TRY.
                     CALL METHOD lr_cep->si_servico_cep_out
                       EXPORTING
                         output = output
                       IMPORTING
                         input  = input.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
    My doubt is : How to know the call method worked?
    In call function i use = if sy-subrc = 0 for check the return but can i use it after call method ?
    thanks a lot.

    there is an importing which is used to get back data.
    once you process input then you can decide whether method worked or not.

  • Doubt in Workflows using Programming Exits on OO ABAP

    I have a doubt on workflows:-
    Let me brief you about my requirement:
    I am trying to update some Master data using ABAP Methods through Programming Exits in a Workflow.
    I managed to find an OO method that can fetch the workflow container values directly into the structure.
    While testing the workflow:-
    The OO ABAP method executes and successfully updates the master tables.
    However, a calling method (that triggers this method indirectly), raises an exception called SWF_RUN_WIM_EXEC_INTERRUPTED.  
    The exception is caught within the caller method and the workflow errors saying that “the method ABC… cannot be executed.”
    The caller method is:-
    CL_SWF_RUN_WORKFLOW_START
    The exception is raised on execution of the following statement:-
    CALL METHOD me->start_workitem( lh_wi_handle ).
    One reason for this is that the workflow is still not completed and still in “READY” state.
    Alternative method
    Once the Master data is updated successfully,
    I tried to use the FM SAP_WAPI_WORKITEM_COMPLETE to end the work item or tried another FM to suspend the workflow.
    Now it gives an error saying that these FMs are restricted from use during run-time execution.
    Query
    Do you have an idea why the exception is raised and how to track/prevent the same?
    Can you suggest any other alternative?  Your valuable advice is urgently needed.
    Thanks a million in advance,
    Best Regards,
    Vinod

    Check the code
          CLASS zcl_event_handler IMPLEMENTATION
    CLASS zcl_event_handler IMPLEMENTATION.
    Top-of-page event
      METHOD top_of_page.
        PERFORM event_top_of_page
                USING z_dyndoc_id.
      ENDMETHOD.   "METHOD top_of_page
    Change Status Button
      METHOD handle_toolbar.
        IF NOT pa_prodr IS INITIAL.
          DATA: lz_toolbar  TYPE stb_button.
          CLEAR lz_toolbar.
          MOVE    'CHANGE_STATUS'  TO lz_toolbar-function.
          MOVE    text-001         TO lz_toolbar-text.
          APPEND  lz_toolbar       TO e_object->mt_toolbar.
        ENDIF.          "IF NOT pa_prodr IS INITIAL
      ENDMETHOD.   "METHOD handle_toolbar
    Handle User Command
      METHOD handle_user_command.
        CASE e_ucomm.
          WHEN 'CHANGE_STATUS'.
            LOOP AT    it_output
                 INTO  wa_output.
              IF wa_output-chk_box EQ kc_x.
                z_flag = 1.
                EXIT.
              ENDIF.          "IF wa_output-chk_box EQ kc_x
            ENDLOOP.      "LOOP AT it_output INTO  wa_output
            IF z_flag EQ 1.
              PERFORM display_selected_data.
            ELSE.
              MESSAGE i001(zzrefn01)
                      WITH text-023.
            ENDIF.       "IF z_flag EQ 1
        ENDCASE.      "CASE e_ucomm
      ENDMETHOD.   "METHOD handle_user_command
    ENDCLASS.   "zcl_event_handler IMPLEMENTATION

Maybe you are looking for