Variants -- with changing value!!!

Hi,
I want to run a program by using the SUBMIT keyword and passing a variant using USING SELECTION-SET <variant name>
And the variant changes its values for each execution of the SUBMIT statement.
According to the replies to a similar question posted in this forum, I found that we can have constant input values in a VARIANT and pass the changing values using the WITH keyword.
is there any other way to achieve this other than the above solution..........
any help wud greatly be appreciated.!!!!!

Hmm, you could set up multiple variants and change which variant you call the program with each time you SUBMIT.  Example:
SUBMIT program_name USING SELECTION-SET variant1 AND RETURN.
SUBMIT program_name USING SELECTION-SET variant2 AND RETURN.
(and so on).
Another way to do it is to specify the fields separately, like this:
SUBMIT program_name WITH parameter1 = w_field1 AND parameter2 = w_field2
AND RETURN.
You can use this same statement multiple times, changing the values of w_field1 and w_field2 between calls (for instance, by putting the submit statement inside a LOOP, ENDLOOP).  I hope this helps.
- April King

Similar Messages

  • Call program using submit with variant that changing value

    Hi All,
    I need to call a report with variant and abstract the data back to my current program.
    so far,
    i use following method
    SUBMIT RFITEMAR USING SELECTION-SET 'XXX'
           EXPORTING LIST TO MEMORY
           AND RETURN.
    DATA list_tab TYPE TABLE OF abaplist.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
      DATA: L_ABAPLIST LIKE ABAPLIST OCCURS 0.
      DATA: BEGIN OF L_ASCITAB OCCURS 0, 
                LINE(2048),
              END OF L_ASCITAB.
      CALL FUNCTION 'LIST_TO_ASCI'
           EXPORTING
                LIST_INDEX         = -1
           TABLES
                LISTASCI           = L_ASCITAB
                LISTOBJECT         = list_tab
           EXCEPTIONS
                EMPTY_LIST         = 1
                LIST_INDEX_INVALID = 2
                OTHERS             = 3.
    However, the problem is that i need to get some value from variant 'XXX' and keep changing it.
    I have try function module "RS_VARIANT_VALUES_TECH_DATA" to get the variant details.
    But, it just doesn't get me back all the details of the variants.
    Are there any way i could read the variants in detail? i even try to read LRAW data from table vari. but there are no function module to convert the LRAW to either char or STRING.
    Thanks.
    Edited by: simplekx on Jun 20, 2011 4:43 PM

    You can use the FM "RS_CHANGE_CREATED_VARIANT" to change the variant values for already created variant and the FM "RS_VARIANT_CONTENTS" to get the variant values. Instead of changing the variant values and then passing to the Submit, you can directly pass the values to the Submit through..WITH SELECTION-TABLE seltab or ... WITH p IN sel variant of the Submit.

  • Variants with selection values

    Hi All,
    Need to have a variant for a planning folder which is restricted to a particular value for one of the folder variables.
    Say cost center is the header variable and i need to assign a variant to the user which opens with value of cost cneter as "120111"
    But for some other user variant value changes.
    Can this be done?
    I tried using "maintain set variables" value in table TVARVC and using the parameter in the variant at start of planning folder. But it doesnt work.
    Any suggestions would be appreciated.
    Thanks,
    Vidya.

    Hi All,
    Thanks for your inputs. But our layouts are going to be used by many users and also there will be some users who would require to see all cost centers.
    So we need some variants for the folder which can hold a particular value of cost center.And this would be assigned to the user role.
    Something of the sort BW variant in queries are used.
    Hope the requirement is clear.
    Thanks,
    Vidya.

  • Creating spreadsheet with changing values

    I am trying to create a spreadsheet where the result depends on the value of 2 options selected. Option 1 is a list of different TV manufactures. Option 2 will provide a list of model numbers depending on which manufacturer was chosen in option 1 and finally box 3 will show a list of remote control codes depending on what was chosen in option 2.
    My questions are as follows;
    How do you create a further list for option 2 that changes depending on what was chosen in option 1?
    How do you have it so the final result in box 3 shows a list of codes depending on the value chosen in option 2?
    My second question may be answered by the answer to my first question but i'll include it anyway
    I currently have a list created for the manufacturers in option 1.
    Option 1 result is set up (and will be shown) in B5
    Option 2 result is set up (and will be shown) in B9
    And the final result will be shown in B14

    Kona2010 wrote:
    I am trying to create a spreadsheet where the result depends on the value of 2 options selected. Option 1 is a list of different TV manufactures. Option 2 will provide a list of model numbers depending on which manufacturer was chosen in option 1 and finally box 3 will show a list of remote control codes depending on what was chosen in option 2.
    My questions are as follows;
    How do you create a further list for option 2 that changes depending on what was chosen in option 1?
    How do you have it so the final result in box 3 shows a list of codes depending on the value chosen in option 2?
    Here's a solution that gets part way to what you want. Rather than a list of codes in a single cell, though, it presents the list in multiple cells across a single row. A revision to the way data is entered on the lookup table to open the list in a single cell is offered at the end of the notes below the illustration.
    Three table (Select Mfg, Results, and Lookup table) are used. Lookup table may be placed on a separate sheet.
    The second copy of Results (with all rows and columns shown) is provided for the explanation below, and would not be included in your version.
    Select Mfg is a two cell table. A2 is a pop-up menu containing a placeholder entry (---) and the names of all manufacturers represented on Lookup table.
    Results contains a row for each manufacturer
    Column B in each row is a pop-up menu listing model numbers for the models made by that manufacturer.
    Column C compares the manufacturer name in column A (hidden) with the name chosen in A2 of Select Mfg, returning TRUE ifthey match, FALSE if they do not. Formula (in C2):
    =A2=Select Mfg::$A$2
    Filled down the rest of column C.
    Cells to the right of these (columns D to F in the example) lookup the codes for the manufacturer and model number selected. Formula in D2:
    =IF($C,VLOOKUP($B,Lookup table :: $A:$D,COLUMN()-2,FALSE),"")
    Filled down and right.
    The Reorganize dialogue is used to show only the header row of Results and the row with TRUE in column C.
    Select the Results table, Click the Reorganize button to open the dialogue.
    In the “Show rows... section, choose: Column C    is    TRUE
    then click the check box.
    Revision: To show all codes for a given model in a vertical list in one cell, enter the codes for that model in one cell (column B of the Lookup table), pressing option-return after each code.
    eg. for the codes shown in row 4 of the Lookup table, to the right of Model No. K8032, you would type the following into B4:
    2-1option-return+2-2+option-return2-3   (where option-return means press the option key, tap the return key, release the option key)
    The columns for C-2 and C-3 would not be needed in this version.
    Placing the results as requested can be done by inserting the formulas below in the three listed cells on your main table (after making the revision above to the Lookup table and Results table.
    B5:   =Select Mfg :: $A$2
    B9:   =VLOOKUP($B$5,Results :: $A:$D,COLUMN(),FALSE)
    B14: =VLOOKUP($B$5,Results :: $A:$D,COLUMN()+2,FALSE)
    Note; Although the last formula does return the full list of codes for the chosen model, it did not, in my test, automatically resize row 14 to display the whole list as shown in the Results table above. You will need to set the row height to accommodate the longest list that will occur, or adjust it for each list.
    I would recommend taking a close look at VLOOKUP in the iWork Formulas and Functions User Guide. You'll find a link to the guide (and one to the equally useful numbers '09 User Guide) in the Help menu in Numbers.
    Regards,
    Barry

  • How to repeat duplication with changing values?

    Hello all!
    First of all - english is not my first language so I don't really know how to explain this in an easy way (and therefore I don't know what to search for either). Maybe a better topic title is needed as well.
    I made an illustration to show what I need, I guess it's easier to understand than my explanation below...
    QUESTION: I have a circle. I want to make a copy of this circle for, say, 80 % of the original size. I'd like to repeat the duplication so the next copy have the same distance to the second circle as between the first two circles (in other word the percentage would change between tranformations) - and so on.
    Hopefully there is some easy way to achieve this so I don't have to do it manually.
    Thanks in advance for any advice!
    (Btw, I use CS5)

    Thank you for your quick reply! This works! I found out another way to do it (sometimes it seems to help with the thinking process just to start a new topic...); the Transition-tool. The downside is that I cannot insert the distance that I wan't to use, so you're advice may be better.
    Thanks again!

  • Installments - first installment with changing value

    Hello Experts,
    My customer requires to have such an installment scenario.
    Let's say we have Material A for $1000 it is sold in 4 installments.
    Installement 1 - $250
    Installement 2 - $250
    Installement 3 - $250
    Installement 4 - $250
    that's pretty easy and we can use installment payment terms.
    the situation is a bit complicated if a customer decides to pay some money in advance, let's say $200
    Material A - $1000, 200 paid in advance
    Installement 1 - $200
    Installement 2 - $200
    Installement 3 - $200
    Installement 4 - $200
    How can i configure sales in installments when customers pay in advance some money in the beginning.
    Please advise
    thanks a lot for your help
    Points will be granted

    hi
    Your requirement can be fulfilled through down payment scenario
    configure in such a way that $200 will be received as advance or down payment and balance amount in instalments
    for down payment search the forum you will get an idea how to configure the down payment with instalment plan
    regards

  • Defining Variant with Dynamic values

    I want to schedule a report say Me2N so that every day it will give me purchase orders created today. I am defining variant for it. How to define Document date in variant so that every day it takes currrent system date.

    Hi,
    In the ME2N transaction code when you are saving the variant, you can set up the status of field. Here if you will scroll right you can see last three columnu2026SELECTION VARIABLE, OPTION AND NAME OF VARIABLE(input only using F4)
    Now in the third last column (SELECTION VARIABLE) press F4 and select the D(Dynamic date calculation) and after this click on last column from right side NAME OF VARIABLE and select the CURRENT DATE and save the varient.
    Now this variant will take the document date every day as a todayu2019s date.
    I hope it will help.
    Regards,
    Manish

  • Why is the difference in execution speed of the function "SetCtrlVa​l" between constant and changing values so small ?

    In my large application (1 MB exe-file) I am continuously updating a lot of numeric controls with new values. Most of them do not really change their value. Within my search of improving the performance of my application I noticed, that there is only a small difference of the execution speed between a call of "SetCtrlValue" with constant values and calls with changing values. It runs much faster (25 times on my PC), if I get the actual control value with "GetCtrlVal", compare it with my new value an do a call to "SetCtrlVal" only if the current value and the new value are different.
    My questions to CVI-developers is:
    Isn't it possib
    le to do this compare within the function "SetCtrlVal"
    My question to all CVI-users is:
    Does anyone have similar tips to improve the performance of CVI applications ?
    I developed a small test application for this problem, which I can mail to interested users.

    What takes the extra time is the redraw of the control. When you call SetCtrlVal we ALWAYS redraw the control. We wouldn't want to build in functionality to check if the value was the same because that would add additional time to the SetCtrlVal in every case. If you want to do it outside of the loop you can as you have done above. You have a few options. First, keep a previous value variable for the controls that you can use to determine whether to set the control value. I.E.
    int oldVal = 0;
    int newVal = 0;
    if(newVal!=oldVal) {
    SetCtrlVal(..., newVal);
    oldVal = newVal;
    Also, if you set the value of a control through SetCtrlAttribute instead, there is no built in redraw of the control (which is what takes all the time). Using SetCtrlAttribute
    to set the value is very fast, but remember there isn't a built in redraw on the screen to display the new number.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • Change values of select option in fuction of the variant

    Hi abappers,
    I want change the data that contain several select-options.
    I have a table internal (c_varint) that I obtain with the next code:
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
         EXPORTING
              report                = '/1BCDWB/DBBKPF'
              variant               = p_varint
    *         MOVE_OR_WRITE         = 'W'
    *         NO_IMPORT             = ' '
    *         EXECUTE_DIRECT        = ' '
    *    IMPORTING
    *         SP                    =
         tables
    *         L_PARAMS              =
    *         L_PARAMS_NONV         =
    *         L_SELOP               =
    *         L_SELOP_NONV          =
              valutab               = c_varint
    *         OBJECTS               =
    *         FREE_SELECTIONS_DESC  =
    *         FREE_SELECTIONS_VALUE =
    *    EXCEPTIONS
    *         VARIANT_NON_EXISTENT  = 1
    *         VARIANT_OBSOLETE      = 2
    *         OTHERS                = 3
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    and my select-options:
    SELECT-OPTIONS I1 FOR BKPF-BUKRS.
    SELECT-OPTIONS I2 FOR BKPF-BELNR.
    SELECT-OPTIONS I3 FOR BKPF-GJAHR.
    SELECT-OPTIONS I4 FOR BKPF-BLART.
    SELECT-OPTIONS In ...
    Now I want change the values but I got not him to changed it to me :
    loop at c_varint where selname eq i1.
       MOVE-CORRESPONDING c_varint to i1.
    endloop.
    loop at c_varint where selname eq i2.
       MOVE-CORRESPONDING c_varint to i2.
    endloop.
    loop at c_varint where selname eq i3.
       MOVE-CORRESPONDING c_varint to i3.
    endloop.
    loop at c_varint where selname eq i4.
       MOVE-CORRESPONDING c_varint to i4.
    endloop.
    but I dont obtain the data
    Can you help me, please?
    Cordial greetings.

    Hi,
    the documentation of the fm you´re using says:
    RS_VARIANT_CONTENTS
    This function module checks whether any parameters or select options of the variant have changed. If they have, it outputs an error message (variant obsolete).
    have you checked fm RS_CHANGE_CREATED_VARIANT instead?
    the documentation of this fm says:
    RS_CHANGE_CREATED_VARIANT
    Functionality
    This function module enables modification of a variant without processing the selection screen. In the table VARI_CONTENTS, you must supply all select-options and parameters of the variant with values. Any selection criteria missing from this table are set to their initial values in the variant. If no value is specified for the structure description (parameter VARI_DESC), all fields - except the name of the last user to make the change, the time of the change, the version and the language - are set to their initial values. The table VARI_TEXT is optional
    Best regards

  • Mass changes of Material Master field with different values

    Hi,
    How to change a field in Material Master for more than thousand materials. I think MM17 can only be used for mass changes of materials with same values. I need to upload different values for different materials. Is there any other way to do this.
    Thanks,
    K R Vishnu Kumar

    Hi Kumar.
    I think you have to use LSMW for mass updation for Material Master fields with different values.
    Regards,
    Rahul.

  • How to change stored procedure with Table Valued Parameter

    I am not sure how to change the normal stored procedure with Table Value Parameter.Do I have to create a separate Table or do I have to create a datatype. Can you please help me with this
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF]
    @dp_id char(32),
    @dv_id char(32),
    @em_number char(12),
    @email varchar(50),
    @emergency_relation char(32),
    @option1 char(16),
    @status char(20),
    @em_id char(35),
    @em_title varchar(64),
    @date_hired datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    MERGE [dbo].[em] AS [Targ]
    USING (VALUES (@dp_id, @dv_id , @em_number, @email, @emergency_relation, @option1, @status, @em_id, @em_title, @date_hired))
    AS [Sourc] (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired)
    ON [Targ].em_id = [Sourc].em_id
    WHEN MATCHED THEN
    UPDATE
    SET dp_id = [Sourc].dp_id,
    dv_id = [Sourc].dv_id,
    em_number = [Sourc].em_number,
    email = [Sourc].email,
    emergency_relation = [Sourc].emergency_relation,
    option1 = [Sourc].option1,
    status = [Sourc].status,
    em_title = [Sourc].em_title,
    date_hired = [Sourc].date_hired
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title,date_hired)
    VALUES ([Sourc].dp_id, [Sourc].dv_id, [Sourc].em_number, [Sourc].email, [Sourc].emergency_relation, [Sourc].option1, [Sourc].status, [Sourc].em_id, [Sourc].em_title, [Sourc].date_hired);
    END;

    It's not clear how you would change the procedure. But assuming that you want to replace the existing scalar parameters with tabular input, this is how you would do it. You first create a table type:
    CREATE TYPE  Insertor_type AS TABLE
        (dp_id                char(32),
         dv_id                char(32),
        em_number            char(12),
        email                varchar(50),
        emergency_relation   char(32),
        option1              char(16),
        status               char(20),
        em_id                char(35),
        em_title             varchar(64),
        date_hired           datetime)
    Then you change the procedure header:
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF] @tvp Insertor_type READONLY AS
    And finally you change the USING clause:
       USING (SELECT dp_id, dv_id , em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired
              FROM   @tvp) AS [Sourc] ON [Targ].em_id = [Sourc].em_id
    The rest is fine as it is.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

  • Choosing variant blocks radiobutton values.  Is there a work around?.

    Dear Forum participants,
    I have a simple radiobutton group:
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    PARAMETERS :  R3ALL RADIOBUTTON GROUP RG3,
                  R3DEL RADIOBUTTON GROUP RG3,
                  R3CCC RADIOBUTTON GROUP RG3.
    SELECTION-SCREEN END  OF BLOCK B1.
    Which I then use in the code for instance:
      if r3all = 'X'.
           write : / r3all.
      elseif r3del = 'X'
            write : / r3del.
      elseif r3CCC = 'X'.
            write : / r3CCC.
      endif.
    The selection and code works fine if I don't select a variant.
    If I call a selection screen variant with one of the radio buttons set (for instance with r3del = 'X'), then changing the radiobutton selection on the screen after the having called up the variant is ignored.  Debug in the code shows that r3del is always set,  even if I selected another button like r3CCC.
    Anyone know why or how I can fix this behavior?  Or is this and SAP bug?

    Thanks for your idea SaiRam .  I tried this but it did not work.  I also created a new variant and if, after I choose the variant, I change the radio button selection, only the variant's value is used, not the one newly selected.

  • Problems with F4 Value Help in NW2004s Portal

    Hello,
    we are having some troubles with the F4 ValueHelp Extension from the Advanced BSP Programming book (and the blogs of course).
    We've implemented the solution on a 4.7 backend and portal 6.0. No problems there, everything was working fine.
    We now moved to erp2005 (WebAS 700) and NW2004s Portal (7.0).
    The popup shows and I can select entries from the list. But when clicking the ok icon a javascript error is thrown stating that 'parent.document.getElementById(...)' is null or no object.
    I think the problem is, that by making a call to 'parent' we are searching in the portal frame and not the BSP. There (in the portal frame) the element is not known so the error is thrown.
    I allready changed from the dialog_ie6.js provided on the BookCD to the one delivered by SAP. Did nothing regarding the error.
    I also tried changing ZCL_BSP_M_INPUT_HELP->BUILD_ACCEPT_SELECTION_SCRIPT. I changed all the "parent.document.get..." "to document.get...". The error message was still the same, 'parent.document.getElementById(...)' is null or no object.
    So now I'm kind of stuck. If I try the example outside the portal everything works as expected. So this clearly seems to be a problem with the portal integration. All involved BSP-Apps are marked as "supports portal integration".
    Any ideas on this topic?
    Thanks and kind regards,
    Alexander Sperling

    I have a working solution to the problem.  It isn't the nicest solution because it will probably require some modifications to the application that hosts the value help, but we will get to that in a second.
    I tried many different ways to come up with a solution that would still work via JavaScript. The portal is now loading the popup javascript in the master frame.  It registers event handlers so that if any application triggers a popup internally it "hi-jacks" the event.  So regardless of what I change in the BSP javascript library, it gets overriden by the portal one. The portal also now even enforeces its theme on the inner page in the popup.  Truly the portal takes complete control over the inner html of the popup.
    To make things worse the popop has not path to reach the source that triggered it.  The source objects are tracked in the javascript, but because the master frame takes over; the popup window only has access and visibility to the master frame and the navigation frame.  In essence in the DOM it is now higher in the stack than the object that actually triggered it. 
    Web Dynpro gets around this because it doesn't use any client side mechanisms to communicate it results back to the source frame. Web Dynpro has the luxury of always being stateful and therefore can make certain assumptions that would never work in BSP.  The hi-jacking is an excellent solution for Web Dynpro.  The portal can then override the functionality of Web Dynpro - providing the new functionality of floating the dialog box over the entire portal - without having to make any changes to the Web Dynpro Framework.  However they never had our little BSP solution in bind obviously.
    It might be possible to completely rewrite the popup_ie.js and popup_ns.js to use all different event, method and variable names.  This separate version could then provide complete separation from the portal script. However this is just a theory. I'm afraid that I wouldn't have the bandwidth to rewrite the entire script right now so I focused on a quicker solution.
    The only approach that I could come up was to follow the Web Dynpro approach and return to the server with the value. To do that I used Portal Eventing.  Portal Eventing allows us to pass a value to the source frame regaurdless of our relative positions in the DOM. 
    In my inner BSP application for the value help (ZES_VALUEHELP), I made the following change in the model method BUILD_ACCEPT_SEL_SCRIPT_V2.  At line 141 I changed the logic.  Instead of using JavaScript to write the selected value back into the source element, we will just trigger a Portal Event:
    ****With an InputField we write the contents directly back into the element
          ELSE.
            CONCATENATE me->js_close1
            `portalFireEvent('com.sap','`
            me->element_id
            `',"`
            key
            `");`
             INTO me->js_close1.
            EXIT.
    The other change is within the Element handler class for inputHelpV2 - ZCL_ES_BSP_ELMNT_INPUT_HELP_V2.  We need to register the listener for the Portal Event. Therefore in DO_AT_BEGINNING we will add the follwing at line 23 (right after we place the Element Id into the URL Parameters Table.
      data: portal_event type ref to cl_portal_event.
      portal_event = cl_portal_event=>factory(
        name = <wa_params>-value
        namespace = 'com.sap' ).
      while m_page_context->element_process( element = portal_event ) = co_element_continue.
      endwhile. "End portalEvent Render
    Overally using the portal eventing actually is an intersting approach.  There is only one drawback, now we have a server side event.  That being the case, our application now needs some event logic to process this event and populate the value. Depending upon if you are using MVC, Data Binding, or Flow Logic this could vary - and would have to handled by each application. The nice thing about the old approach was that it all happened via JavaScript on the Frontend and didn't require the application programmer to do anything - that was obviously its weakness as well.

  • I do not obtain to change value in price conditions bapi CHANGE_SALES_ORDER

    Hi all,  
    We are developing a new solution using this RFC to maintain Sales Orders from the Legacy System.
    In some situations, it will be necessary to change values of the Item Price Conditions in Sales Orders already created, in order to attend a Legacy Systems requests.
    We tried to use the follow keys, but without a good result:
    IX_KONVKOMX-UPDKZ = D (Delete) - Doesn't works
    IX_KONVKOMX-UPDKZ = U (Update) - Insert a new line in Pricing
    IX_KONVKOMX-UPDKZ = I (Insert) - Works as U (Update)
    Could you please clarify why the key "U" doesn't works as Update and
    if there is any way to make this kind of modification?
    I verified you vary answers in this forum, but none was useful.
    Thanks a lot

    example:-
    *& Report  ZSALESORDER_CHANGE
    REPORT  ZSALESORDER_CHANGE MESSAGE-ID 38.
    Selection Screen Definitions *
    PARAMETERS: p_vbeln TYPE vbap-vbeln OBLIGATORY, "Order Number
    p_posnr TYPE vbap-posnr OBLIGATORY, "Order Item
    p_etenr TYPE vbep-etenr OBLIGATORY, "Schedule Line
    p_reqqty TYPE bapischdl-req_qty OBLIGATORY. " Order Qty
    Internal Tables/Structures/Variables for calling BAPI. *
    DATA: i_hdr TYPE bapisdh1,
    i_hdrx TYPE bapisdh1x,
    i_ret TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
    wa_ret TYPE bapiret2.
    DATA: BEGIN OF i_sched OCCURS 10.
    INCLUDE STRUCTURE bapischdl.
    DATA: END OF i_sched.
    DATA: BEGIN OF i_schedx OCCURS 10.
    INCLUDE STRUCTURE bapischdlx.
    DATA: END OF i_schedx.
    START-OF-SELECTION Event *
    START-OF-SELECTION.
    *" Initialize internal tables.
    REFRESH: i_sched, i_schedx, i_ret.
    CLEAR: i_sched, i_schedx, i_ret.
    *" Fill required ORDER_HEADER_IN data.
    i_hdrx-updateflag = 'U'.
    *" Fill required SCHEDULE_LINES data.
    i_sched-itm_number = p_posnr.
    i_sched-sched_line = p_etenr.
    i_sched-req_qty = p_reqqty.
    i_schedx-updateflag = 'U'.
    i_schedx-itm_number = p_posnr.
    i_schedx-sched_line = p_etenr.
    i_schedx-req_qty = 'X'.
    APPEND i_sched.
    APPEND i_schedx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = p_vbeln
    order_header_in = i_hdr
    order_header_inx = i_hdrx
    TABLES
    return = i_ret
    schedule_lines = i_sched
    schedule_linesx = i_schedx.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    LOOP AT i_ret.
    WRITE / i_ret-message.
    ENDLOOP.

Maybe you are looking for