How to create a variant in VA01

Hi Gurus,
Can you teach me how to create a variant in VA01?  I'd like to have a default value in the sold to party field.
Thanks,
Paul

hi,
To show a default sold-to-party in this field when the user creates a sales order (VA01) we can use a function exit .This function exit is located in enhancement no V45A0002 . Before we can choose the exit we have to create a project in CMOD after that enter V45A0002 in the enhancement field and click on the components . In the components you will see the exit EXIT_SAPMV45A_002 . This exit is used for our purpose.
Double clicking on this exit will takes us to function builder (SE37) . This function exit has one exporting parameters and two importing parameters, we are interested in exporting parameter which is E_KUNNR of type KNA1-KUNNR i.e if we move the desired customer name to this structure(E_KUNNR) it will be shown in the field as the default value when we create the sales order. This function also contains a customer include ZXVVA04 . This include will be used to write our custom code .
Double clicking on this include and it will prompt us that this include does not exists do you want to create this object ,select yes and the include will be created .In this include we can write our own code that will fill the field E_KUNNR.
e.g. E_KUNNR = 301.
Activate the include and Activate the project. Now when ever the SALES ORDER will be created , sold-to-party field will come up with a predefined customer .
regards
sadhu kishore

Similar Messages

  • How to create new variants - VA05

    Hi All,
    I'm new in SD
    How to create new variants in Tcode VA05, our client wants to create new variants as per user selections, pls advise how to resolve this issue.
    Regards,
    Sankaran

    Below is an example of step by step explanation...Following that u cud do that in VA01...
    [https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/transactionVariant-AStepbyStepGuidefor+Creation]..
    Hope this helps...

  • MMPV - Close period - How to create a variant

    Hello all,
    Transaction MMPV is used to close the MM period and open a new one. Currently, we run this transaction every month MANUALLY.
    We would like to create a variant that will open the new period automatically every month. The only problem is the period / year that changes every month (I do not know how to create a variant with changed values - if it is at all possible).
    How can we create a variant that will run every month to close the MM period ?
    Thanks for your help,
    Isaac

    Hello Isaac
    It is possible......But to make it happen you need to go with date field and not with Period and year.
    Steps -
    1 - Enter field FROM Comp Code and TO Comp Code
    2 - Enter the date (E.g - 05-Mar-2007)
    3 - Save as varient....Give the varient names as required.
    4 - Activate the 4th checkbox (Selection variable) in front of date field
    5 - Click on button 'Selection variable' at the top of screen.
    6 - Click on YELLOW light. This will turn it GREEN. Now you have 1st light as YELLO which was previously yello.
    7 - Click on the down arrow just below the yello light.
    8 - Select the appropriate option and save the varient.
    The day of batch job scheduling depends upon the options you selected in the 8th step.
    I hope it clarifies your dought and will allow you to create the varient as per your requirement.
    Best Regards
    Avinash

  • How to create a variant in ecatt?

    Hi all,
    I am new to Ecatt scripting. I hav a requirement from the user, that one ecatt is used for two sales org using two variants.
    I recorded as per the requirement ( first i created one basic script and called it in a master script ). Now I need to create two variants for the master script for the sales org.
    So could any one suggest how to create a variant in ecatt?
    Thanks in advance.
    Vijayakumar.G

    Hello Vijay,
    After recording parameterize everything whatever you want.
    In parameterization table leave the value field as empty, I mean don't give any value.
    Select the following in the menu,
    Utilities>Test configuration>Create
    Now, test configuration name will have the same of the test script name.
    Provide the details in the configuration tab. Then in the variants tab select the second radio button "Internal variants".
    In the variant table you can see the default variant "ECATTDEFAULT". You can make use of  this also. Otherwise you can also create your own variants by clicking "Insert variant" button.
    The variables whatever you have created in the test script will be there in the table. Now, Create variant and provide values for each variables.
    You can also select the variants which need to be executed.
    Now you can run the test configuration. It will be running number of times according to the created number of the variants.
    You can also create Test data for your test script and configuration.
    Try this, I hope it will help.
    Feel free to reward if it helps.
    Regards,
    Gopi
    Edited by: Gopinath K S on Oct 7, 2008 7:37 AM

  • How to create a variant selection screen

    Hi experts,
    Can you tell me " How to create a variant selection screen ".
    Please it's urgent.........
    Thanks
    Basu

    Hi ,
    Goto your selection screen
    Make entries in the fileds od the selection screen
    press save button, it will ask you for the mane of the Variant
    Give the name of  the Variant and save it
    Variant is now created for the selection screen.
    Reward if useful.
    Regards,
    Shilpi

  • How to create t-code for a table and how to create transaction variant???

    Hi,
    I have created a custom table zsark.
    Now my requirement is : I have to create a transaction variant zsark_var for sm30 and table zsark. I have to disable the output of the first screen. I have to assign the transaction variant to the transaction code of table zsark.
    Now,
    1.     how to create transaction code to a table. Can any one give me the 
                    staps??
    2.     how to create transaction variant for the above requirement???
    Thanks & Regards,
    Sarkar

    Hi
    1 Goto SE93 transaction
    2 Choose 5th option Transaction with parameters
    3 Give transaction : SM30, Check Skip Initial Screen Press Enter
    4 Goto Bottom left corner, click F4 select viewname, on right hand side give table name
    5 Press one more time F4, choose update , mark it X on right side.
    6 save the transaction.
    Thanks
    sandeep
    reward if helpful

  • How to create purchase order using VA01 for BAPI?

    how to create purchase order using VA01 for BAPI?

    Hi Arun,
    Please check this link
    Example Program for BAPI_PO_CREATE1
    Re: BAPI_PO_CREATE1
    Questions in BAPI_PO_CREATE1
    Problem with BAPI_PO_CREATE1
    *& Report BAPI_PO_CREATE *
    REPORT bapi_po_create.
    Input File Declaration
    TYPES: BEGIN OF ty_input_file,
    column1 TYPE char50,
    column2 TYPE char50,
    column3 TYPE char50,
    column4 TYPE char50,
    column5 TYPE char50,
    column6 TYPE char50,
    column7 TYPE char50,
    column8 TYPE char50,
    column9 TYPE char50,
    column10 TYPE char50,
    column11 TYPE char50,
    column12 TYPE char50,
    column13 TYPE char50,
    column14 TYPE char50,
    column15 TYPE char50,
    column16 TYPE char50,
    column17 TYPE char50,
    column18 TYPE char50,
    END OF ty_input_file.
    DATA: i_input_file TYPE STANDARD TABLE OF ty_input_file,
    wa_input_file TYPE ty_input_file.
    CONSTANTS: c_path TYPE char20 VALUE 'C:\',
    c_mask TYPE char9 VALUE ',.,..',
    c_mode TYPE char1 VALUE 'O',
    c_filetype TYPE char10 VALUE 'ASC',
    c_x TYPE char01 VALUE 'X'.
    PARAMETERS : p_fname LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    Browse Presentation Server
    PERFORM f4_presentation_file.
    START-OF-SELECTION..
    Read presentation server file
    PERFORM f1003_upload_file.
    IF NOT i_input_file[] IS INITIAL.
    PERFORM split_data.
    ENDIF.
    *& Form f4_presentation_file
    *& F4 Help for presentation server
    FORM f4_presentation_file .
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    def_path = c_path
    mask = c_mask
    mode = c_mode
    title = text-001
    IMPORTING
    filename = p_fname
    EXCEPTIONS
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    OTHERS = 5.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM. " f4_presentation_file
    *& Form f1003_upload_file
    *& Upload File
    FORM f1003_upload_file .
    DATA: lcl_filename TYPE string.
    lcl_filename = p_fname.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = lcl_filename
    filetype = c_filetype
    has_field_separator = c_x
    TABLES
    data_tab = i_input_file
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
    ENDIF.
    ENDFORM. " f1003_upload_file
    *& Form split_data
    Collect data for creating Purchase Order
    FORM split_data .
    DATA: i_poitem TYPE STANDARD TABLE OF bapimepoitem,
    i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
    i_poitem_sch TYPE STANDARD TABLE OF bapimeposchedule,
    i_poitem_schx TYPE STANDARD TABLE OF bapimeposchedulx,
    i_acct_*** TYPE STANDARD TABLE OF bapimepoaccount,
    i_acct_assx TYPE STANDARD TABLE OF bapimepoaccountx,
    i_services TYPE STANDARD TABLE OF bapiesllc ,
    i_srvacc TYPE STANDARD TABLE OF bapiesklc,
    i_return TYPE STANDARD TABLE OF bapiret2,
    wa_header TYPE bapimepoheader,
    wa_headerx TYPE bapimepoheaderx,
    wa_poitem TYPE bapimepoitem,
    wa_poitemx TYPE bapimepoitemx,
    wa_poitem_sch TYPE bapimeposchedule,
    wa_poitem_schx TYPE bapimeposchedulx,
    wa_acct_*** TYPE bapimepoaccount,
    wa_acct_assx TYPE bapimepoaccountx,
    wa_services TYPE bapiesllc,
    wa_srvacc TYPE bapiesklc,
    wa_return TYPE bapiret2,
    ws_po TYPE bapimepoheader-po_number.
    break gbpra8.
    wa_services-pckg_no = 10.
    wa_services-line_no = 1.
    wa_services-outl_no = '0'.
    wa_services-outl_ind = c_x.
    wa_services-subpckg_no = 20.
    APPEND wa_services TO i_services.
    wa_srvacc-pckg_no = 10.
    wa_srvacc-line_no = 1.
    wa_srvacc-serno_line = 01.
    wa_srvacc-serial_no = 01.
    wa_srvacc-percentage = 100.
    APPEND wa_srvacc TO i_srvacc.
    LOOP AT i_input_file INTO wa_input_file.
    IF wa_input_file-column2 EQ 'HD'.
    wa_header-doc_type = wa_input_file-column3.
    wa_header-creat_date = sy-datum.
    wa_header-created_by = sy-uname.
    wa_header-vendor = wa_input_file-column4.
    PERFORM conversion_output USING wa_header-vendor
    CHANGING wa_header-vendor.
    wa_header-comp_code = 'DE03'.
    wa_header-purch_org = 'DE03'.
    wa_header-pur_group = 'DE1'.
    wa_header-vper_start = wa_input_file-column9.
    wa_header-vper_end = wa_input_file-column10.
    wa_headerx-comp_code = c_x.
    wa_headerx-doc_type = c_x.
    wa_headerx-creat_date = c_x.
    wa_headerx-created_by = c_x.
    wa_headerx-vendor = c_x.
    wa_headerx-purch_org = c_x.
    wa_headerx-pur_group = c_x.
    wa_headerx-vper_start = c_x.
    wa_headerx-vper_end = c_x.
    ENDIF.
    IF wa_input_file-column2 EQ 'IT'.
    wa_poitem-po_item = wa_input_file-column3.
    wa_poitem-short_text = wa_input_file-column6.
    wa_poitem-plant = wa_input_file-column8.
    wa_poitem-quantity = '1'.
    wa_poitem-tax_code = 'V0'.
    wa_poitem-item_cat = 'D'.
    wa_poitem-acctasscat = 'K'.
    wa_poitem-matl_group = wa_input_file-column7.
    wa_poitem-pckg_no = '10'.
    APPEND wa_poitem TO i_poitem .
    wa_poitemx-po_item = wa_input_file-column3.
    wa_poitemx-po_itemx = c_x.
    wa_poitemx-short_text = c_x.
    wa_poitemx-plant = c_x.
    wa_poitemx-quantity = c_x.
    wa_poitemx-tax_code = c_x.
    wa_poitemx-item_cat = c_x.
    wa_poitemx-acctasscat = c_x.
    wa_poitemx-matl_group = c_x.
    wa_poitemx-pckg_no = c_x.
    APPEND wa_poitemx TO i_poitemx.
    wa_poitem_sch-po_item = wa_input_file-column3.
    wa_poitem_sch-delivery_date = sy-datum.
    APPEND wa_poitem_sch TO i_poitem_sch.
    wa_poitem_schx-po_item = wa_input_file-column3.
    wa_poitem_schx-po_itemx = c_x.
    wa_poitem_schx-delivery_date = c_x.
    APPEND wa_poitem_schx TO i_poitem_schx.
    wa_acct_***-po_item = 10.
    wa_acct_***-serial_no = 01.
    wa_acct_***-gl_account = '0006360100'.
    wa_acct_***-co_area = '1000'.
    wa_acct_***-costcenter = 'KC010000'.
    APPEND wa_acct_*** TO i_acct_***.
    wa_acct_***-po_item = 10.
    wa_acct_***-serial_no = 02.
    wa_acct_***-gl_account = '0006360100'.
    wa_acct_***-co_area = '1000'.
    wa_acct_***-costcenter = 'KC010000'.
    APPEND wa_acct_*** TO i_acct_***.
    wa_acct_assx-po_item = 10.
    wa_acct_assx-serial_no = 01.
    wa_acct_assx-po_itemx = c_x.
    wa_acct_assx-serial_nox = c_x.
    wa_acct_assx-gl_account = c_x.
    wa_acct_assx-co_area = c_x.
    wa_acct_assx-costcenter = c_x.
    APPEND wa_acct_assx TO i_acct_assx.
    wa_acct_assx-po_item = 10.
    wa_acct_assx-serial_no = 02.
    wa_acct_assx-po_itemx = c_x.
    wa_acct_assx-serial_nox = c_x.
    wa_acct_assx-gl_account = c_x.
    wa_acct_assx-co_area = c_x.
    wa_acct_assx-costcenter = c_x.
    APPEND wa_acct_assx TO i_acct_assx.
    wa_services-pckg_no = 20.
    wa_services-line_no = 2.
    wa_services-service = wa_input_file-column9.
    wa_services-quantity = '100'.
    wa_services-gr_price = '100'.
    wa_services-userf1_txt = wa_input_file-column13.
    APPEND wa_services TO i_services.
    wa_srvacc-pckg_no = 20.
    wa_srvacc-line_no = 1.
    wa_srvacc-serno_line = 02.
    wa_srvacc-serial_no = 02.
    wa_srvacc-percentage = 100.
    APPEND wa_srvacc TO i_srvacc.
    ENDIF.
    ENDLOOP.
    CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
    poheader = wa_header
    poheaderx = wa_headerx
    POADDRVENDOR =
    TESTRUN =
    MEMORY_UNCOMPLETE =
    MEMORY_COMPLETE =
    POEXPIMPHEADER =
    POEXPIMPHEADERX =
    VERSIONS =
    NO_MESSAGING =
    NO_MESSAGE_REQ =
    NO_AUTHORITY =
    NO_PRICE_FROM_PO =
    IMPORTING
    exppurchaseorder = ws_po
    EXPHEADER =
    EXPPOEXPIMPHEADER =
    TABLES
    return = i_return
    poitem = i_poitem
    poitemx = i_poitemx
    POADDRDELIVERY =
    poschedule = i_poitem_sch
    poschedulex = i_poitem_schx
    poaccount = i_acct_***
    POACCOUNTPROFITSEGMENT =
    poaccountx = i_acct_assx
    POCONDHEADER =
    POCONDHEADERX =
    POCOND =
    POCONDX =
    POLIMITS =
    POCONTRACTLIMITS =
    poservices = i_services
    posrvaccessvalues = i_srvacc
    POSERVICESTEXT =
    EXTENSIONIN =
    EXTENSIONOUT =
    POEXPIMPITEM =
    POEXPIMPITEMX =
    POTEXTHEADER =
    POTEXTITEM =
    ALLVERSIONS =
    POPARTNER =
    break gbpra8.
    LOOP AT i_return INTO wa_return.
    ENDLOOP.
    ENDFORM. " split_data
    *& Form conversion_output
    Conversion exit input
    FORM conversion_output USING p_ip
    CHANGING p_op.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = p_ip
    IMPORTING
    output = p_op.
    ENDFORM. " conversion_output
    Best regards,
    raam

  • How to create process variant in process chain

    What is a process variant? i try to add Infocube compression to the fi process chain. To accomplish this task, i have to create process variant. please tell me the step by step process how to create process variant and successfully add the compression to the process chain. Can i do it directly in production? Thanks to SDN community that i can count on.

    Hi Rafi,
    <b>Process variants</b>
    The process variant is the name of the process Within the process chain context, it displays the configuration of a process of a particular type set at the time of definition. A variant is only consistently defined together with the process type. A process can have various variants. With the load process for example, the name of the InfoPackage is the name of the process variant.
    The user defines the process variant at the time when the process is scheduled. With some process types, the variants are determined internally and are stored as GUIDs.
    For more info:
    Process Chains
    http://help.sap.com/saphelp_nw04/helpdata/en/8f/c08b3baaa59649e10000000a11402f/content.htm
    Processes
    http://help.sap.com/saphelp_nw04/helpdata/en/7b/d4313b38bea774e10000000a114084/content.htm
    Including InfoCubes in Process Chains
    http://help.sap.com/saphelp_nw04/helpdata/en/d5/e80d3dbd82f72ce10000000a114084/content.htm
       You can create process chains directly in Production. Most of the times system allows(depends on system settings). But this is not a proper way of working. Create in Development and transport it to Production.
    Hope it Helps
    Srini

  • How to create the variant conditions in VK13

    Can anyone plz tell me how to create the variant conditions in VK13.
    Thanks in advance.

    Hi Suresh,
    not sure if this is what you meant.. in VK13 enter the condition for which you want to maintain variant & press
    enter.. fill in the Sales Orgn,Distbn Channel & Divion Values.. Use the menu option Edit> save as Variant> enter the variant name & desc and SAVE..
    Regards,
    Suresh Datti

  • How to create a variant to a maintenance view (trans: SM31)

    Hi gurus.
    I have created a maintenance view (called z_jest). By running it from SM31 there is a variant option. However, I am not able to create the variant which I want to filter a selection upon in this transaction.
    I have even looked into transaction SE54 and created a variant for the maintenance table view there( called z_jestv). Then going back to transaction SM31 and view z_jest, i push 'Variant' radiobutton and type as variant: 'z_jestv', I only get the message: "Variant z_jestv for object z_jest does not exist".
    Can anybody please advice on how to create and/or connect the variant to the maintenance view?
    Regards LL.

    Hi Mahalakshmi
    Thanks for reply.
    When I look into the procedure, there is a prerequisite: "The basis dialog for which the maintenance variant is created already exists."
    I am a little bit unsertain if I miss this 'Basic dialog'. Can you please advice on how to check / create this 'basic dialog' before I go on to create the variant. (I need this 'basic dialog' as input in the procedure you sent.)
    (Note: I have already created a 'maintenance dialog' for the view, but I have a feeling, that is something different...)

  • How to create a variant for  a selection screen  button

    hi ,
          i have  created a selection screen for a normal report .   
    In the selection screen  there is one button after the selct option for company code. when user enters some company code and  presses the button the user i call a able contraol in which user gives some additional values for the comapny code.
    how  do i create variant.  when i create  varaint  for the slection screen  it does  not take into account the  other screen i called .
    so every time user has to click that button and enter some values and execute. please suggest  some way.
    THANKX IN ADAVANCE:)

    Hi,
          Inorder to create a variant for selection screen report, you need to enter valid data on the screen and click on the SAVE button which is available in the Menu.
          And regarding the button you were asking about after select option, it is not created manually it comes automatically,, you can remove this by mentioning no-extension after the select-option. You can get clear information of this if you do F1 help on select-option.
    My advice to you, make effect use of F1 help.
    Edited by: Madhuri on Sep 23, 2008 4:46 PM

  • How to create a variant used in SM30,View variant in Parameter transaction?

    Dear Team,
    I have a view V_TCURR. For which I would be creating a parameter transaction for transaction SM30 by filling the default Values section (VIMDYNFLDS-LTD_DTA_VR, VIEWNAME,TVIMV-VARIANT). The values for first two fields are obvious.
    The question is on TVIMV-VARIANT How can we create a variant which can be used in tcode SM30.
    Delving a  little deeper show that these variants Obsolete since R/3 Release 3.1I: Selection variant for a table or maintenance view.
    Since R/3 Release 4.0, there are view variants instead of selection variants.
    The field only exists for reasons of backwards compatibility.
    If thats is so, How do I use the same in parameter transaction..?
    I have tried creating a view variant and use it parameter transaction but in vain..
    Please help resolve my problem. I hope I am very clear. If still need any clarification, please get back to me.
    Thanks a lot in advance,
    Reagards,
    Sai.
    P.S. Though there are multiple quuestions on simlar subjects none of them has been either answered or is completely relevant to mine.

    Dear Suman,
    Thanks a lot for the answer. Actually the Tcode is getting created if I do what you have said me.
    But when I run the tcode which was created by view variant created, I am not getting the desired details .
    To be more clear..
    Previously there was a variant (TMIMV-VARIANT) created with follwing criteria..
    Table TMIMV.
    TABNAME    VARIANT AS4POS            VIEWFIELD NEGATION OPERATOR     VALUE         AND_OR      TABIX
    V_TCURR     ZTHB     1     KURST     NOT     EQ     M     AND     2          
    V_TCURR     ZTHB     2     KURST     NOT     EQ     DWBP     AND     2          
    V_TCURR     ZTHB     3     TCURR          EQ     THB     OR     4          
    V_TCURR     ZTHB     4     TCURR          EQ     USD     OR     4          
    V_TCURR     ZTHB     5     TCURR          EQ     US$          4     
    When we run tcode created by paramaeter transaction.. viewname as  V_TCURR, TMIMV-VARIANT. I am getting the desired records for updation.
    But if I do the same using View variant with the same selection criteria
    Table            Field name     Operator      Comaparison  AND/OR
                                                                   Value
    TCURR     KURST     NE     'M'     AND
    TCURR     KURST     NE     'DWBP'     AND
    TCURR     TCURR     EQ     THB     OR
    TCURR     TCURR     EQ     USD     OR
    TCURR     TCURR     EQ     US$
    And the run the tcode created by using the view variant .. I am getting No entries found that match selection criteria...
    Could you please help and let me know if I am missing any step.. Kindly also check from your side how this can be achieved.
    Thanks a lot in advance,
    Sai.

  • How to create a variant

    Hi :
       I developed a BDC program using call transaction, and also a tcode for this program.How can i add variants to this tcode.
    from se38 when i enter program name and from menu bar im selecting variants tab, here im creating a new variant and saving it.
    But when i execute my tcode, in selection screen i am not seeing variant option.
    Do i need to add any code for creating a variant in my program?
    Thanks.
    Raghu

    Hello,
    CALl the Transaction U have created fro the BDC. It will show the selection screen. There u fill the data for the field and SAVE button will be there in the menu click it will ask for Variant name give it and save.
    If useful reward.
    Vasanth

  • How to create a variant for a screen (not a selection screen)

    Hi
    I foud a function module RS_CREATE_VARIANT.
    Is this the correct fm for creating screen variant, if yes then pls provide me some help about how to pass values to this fm.
    if not then pls help me to find out new one.
    thnks
    satisfactory answer will be definitely rewarded.
    S@meer

    passing values to RS_CREATE_VARIANT.
    data : LS_VARIANTDESC TYPE VARID.
      DATA : LT_VARIANTTEXT TYPE TABLE OF VARIT ,
             WA_VARIANTTEXT TYPE VARIT.
      DATA : TT_REPORTPARAM TYPE TABLE OF  RSPARAMS,
             WA_REPORTPARAM TYPE RSPARAMS.
    CLEAR LS_VARIANTDESC.
              LS_VARIANTDESC-MANDT   = SY-MANDT.                " gr 46A
              LS_VARIANTDESC-REPORT  = 'ZXXXXX'.
              LS_VARIANTDESC-VARIANT = 'VARIANT'.
              LS_VARIANTDESC-EDAT    = SY-DATUM.
              LS_VARIANTDESC-ETIME   = SY-UZEIT.
              REFRESH LT_VARIANTTEXT.
              CLEAR WA_VARIANTTEXT.
              WA_VARIANTTEXT-MANDT    = SY-MANDT.               " gr 46A
              WA_VARIANTTEXT-LANGU    = SY-LANGU.
              WA_VARIANTTEXT-REPORT   = 'ZXXXXXX'.
              WA_VARIANTTEXT-VARIANT  = 'VARIANT'.
              APPEND WA_VARIANTTEXT TO LT_VARIANTTEXT.
           CALL FUNCTION 'RS_CREATE_VARIANT'
                  EXPORTING
                    CURR_REPORT               = 'ZXXXXX'
                    CURR_VARIANT              = 'VARIANT'
                    VARI_DESC                 = LS_VARIANTDESC
                  TABLES
                    VARI_CONTENTS             = TT_REPORTPARAM
                    VARI_TEXT                 = LT_VARIANTTEXT
                  EXCEPTIONS
                    ILLEGAL_REPORT_OR_VARIANT = 1
                    ILLEGAL_VARIANTNAME       = 2
                    NOT_AUTHORIZED            = 3
                    NOT_EXECUTED              = 4
                    REPORT_NOT_EXISTENT       = 5
                    REPORT_NOT_SUPPLIED       = 6
                    VARIANT_EXISTS            = 7
                    VARIANT_LOCKED            = 8
                    OTHERS                    = 9.
                IF SY-SUBRC EQ 7.
    If variant with same name already exists, change variant
                  CALL FUNCTION 'RS_CHANGE_CREATED_VARIANT'
                    EXPORTING
                      CURR_REPORT               = 'ZXXXXX'
                      CURR_VARIANT              = 'VARIANT'
                      VARI_DESC                 = LS_VARIANTDESC
                    TABLES
                      VARI_CONTENTS             = TT_REPORTPARAM
                    EXCEPTIONS
                      ILLEGAL_REPORT_OR_VARIANT = 1
                      ILLEGAL_VARIANTNAME       = 2
                      NOT_AUTHORIZED            = 3
                      NOT_EXECUTED              = 4
                      REPORT_NOT_EXISTENT       = 5
                      REPORT_NOT_SUPPLIED       = 6
                      VARIANT_DOESNT_EXIST      = 7
                      VARIANT_LOCKED            = 8
                      SELECTIONS_NO_MATCH       = 9
                      OTHERS                    = 10.
                ELSEIF SY-SUBRC NE 0.
                MESSAGE WITH 'Cannot create/change variant for'
                SY-UNAME.
                ENDIF.

  • How to create a variant to a report from another program at run time

    Hi experts,
                   when i am using FM  :  /OSP/REPORT_CREATE_VARIANT to create a report variant from a program then i am getting  an error 'For object /OSP/ERPNR , number range interval 01 does not exist ', how should i avoid it or can any one help me out to create a report variant from another program at run time with the results of the program.so that i can execute the report from here with this variant

    If i understand you,
    - You can use a FM like [RS_CREATE_VARIANT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=rs_create_variant+&adv=false&sortby=cm_rnd_rankvalue] to create a variant and then use it in the [SUBMIT|http://help.sap.com/erp2005_ehp_03/helpdata/EN/fa/096d67543b11d1898e0000e8322d00/frameset.htm] statement USING SELECTION-SET.
    - But you may also use SUBMIT with WITH parameters which doesnt require variant creation and with much less programming efforts.
    - You can mix the two solutions also.
    So what is you actual requirement, also look at some documentation like [ Scheduling a Job: Full-Control Method|http://help.sap.com/erp2005_ehp_03/helpdata/EN/fa/096ce5543b11d1898e0000e8322d00/frameset.htm]
    Regards

Maybe you are looking for

  • The cover art is missing on my playlists songs, but not for songs in the cloud on my iphone 5s

    Ever since I updated to iOS 8, not 8.0.2 (still haven't done that update), the artwork on my music is missing for any songs that are on my phone and in my playlists. My music that is stored in the cloud still has its cover art. All of the songs still

  • Where is the official ROM for S650 and instructions

    Hi, 1. Where can I find the official stock rom for the S650 and instructions on flashing, in case something goes wrong and I need to reflash the phone.There doesn't seem to be anything on the Lenovo website other than the source code. I saw the this

  • XML Schema and .....

    Hi, I am working on SCORM project, in which i uses XML amd dom4j. I need to validate xml against XML Schema, I can do this if my XML refers to single XML Schema (.xsd) file, but my xml refers to multiple XMLSchema files. ??? It the project i need to

  • Why only +String concatation for Operator Overloading ?

    Java does not support operator overloading other than the + operator for addition of two Strings or a number and a String.Why only the + operator and Strings, even when we have a concat() for addition of Strings ? Wondering if anyone could provide me

  • Site Contents Page on SharePoint

    I am currently working on our new sharepoint site on Office 365. We now have a bunch of app tiles on the site contents page that aren't in a useful arrangement. Is there any way to manually arrange/organize these?  Thanks!