Dynamic variant type B

How i use the selection variable type B in dynamic variant??
I have 2 parameters: month and year. Both have been filled with currenth month and year in background job that will be run every day.
In sap help, is mentioned something about memory ID for to do that but i didn´t understand.
Please, help me!

Check this
report zaRs
       no standard page heading line-size 255.
parameters : p_month(2) type c.
parameters : p_year(4) type c.
Initialization.
p_month = sy-datum+4(2).
p_year = sy-datum+0(4).

Similar Messages

  • Create dynamic variante in report

    hello masters, im trying to create a dynamic variant for a report, im following the instructions of document that exists in <blocked site removed by moderator> but the option D- Dynamic date calculation doesnt appear to me in the field that i want to calculate date... the field it is of type S - selection-option... someone have any clue that could be.
    regards and thanks in advance
    Mario
    Edited by: Thomas Zloch on Jul 11, 2011 2:34 PM

    hello Alvaro, thanks for your answer.
    you are right, my field isnt DATE it is CHAR.
    thanks for your help.
    Mário

  • Dynamic variant

    hi all,
      i created a report and that report has to be execute in back ground daily with variant,but my report contains some date field, so i need to change the date value in that varient,how can i do it.How can i create dynamic variant,could you please help me.
    regards,
    Bujji.

    Hi Murali,
    You can do this in the variant itself.
    Please follow these steps
    1. Enter the values in the selection screen
    2. Save the variant using the SAVE button
    3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.
    4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (ie. D - Dynamic date calculation).
    5. Click on the down arrow button and select the option 'Current Date'.
    6. Save the variant.
    Kindly assign points if this is helpful.
    Cheers
    Vinod
    Message was edited by: Vinod C

  • Create dynamic data type in structure

    Hi Experts,
    I am new to ABAP.
    In my scenario data type is varying for the field. for that I need to create dynamic data type in structure, this structure I am using for  internal table for OVS search input.
    Please suggest the solution for this.
    Advance thanks,
    Regards,
    BBC

    Thanks for your quick reply,
    I used your logic like this.
    data:
    ls_component type abap_componentdescr,
    lt_component type abap_component_tab.
    *... (1) define structure components :
    clear ls_component.
    ls_component-name = 'NVALUE'.
    ls_component-type ?= cl_abap_typedescr=>describe_by_name( <fs_seg_v>-fieldname ).
    insert ls_component into table lt_component.
    *... (2) create structure
    data lr_strucdescr type ref to cl_abap_structdescr.
    data lr_data_struc type ref to data.
    lr_strucdescr = cl_abap_structdescr=>create( lt_component ).
    create data lr_data_struc type handle lr_strucdescr.
    field-symbols <fs> TYPE any.
    assign lr_data_struc->* to <fs>.
    your logic is working fine.
    here I am getting feild name (<fs_seg_v>-fieldname) from internal table.
    But I need to assign same field name structure to query parameter.
    FIELD-SYMBOLS: <ls_query_params> TYPE lty_stru_input.
    Please can you suggest how I can refer the field name structure?
    Regards,
    BBC

  • Create Dynamic variant for date field

    Hello all,
    I need to have the current month year displayed in my selection screen in format MM.YYYY and the field is of type SPMON (Period to analyze - month).
    and while saving the variant it is showing only 'T' (entries from TVARVC table)  in  "selection variable" field and not showing 'D' (Dynamic selection) for the above field.
    So,please help me in resolving this issue.
    Thanks in advance.

    hi
    good
    go through this code,i hope this ll help you to create the dynamic variant.
    Please find the sample using RS_CREATE_VARIANT (FM).
    It make use of other FM also , just have a look .
    Hope this may help you.
    REPORT ZEXAMPLE.
    DATA: JVARI_DESC LIKE VARID,
    RC LIKE SY-SUBRC,
    VARIANT_TEXT LIKE VARIT-VTEXT,
    JVT LIKE VARIT OCCURS 0 WITH HEADER LINE,
    SELPA LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    PARMS LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    OBJS LIKE VANZ OCCURS 0 WITH HEADER LINE.
    PARAMETERS: P_VAR LIKE RSVAR-VARIANT. "NAME OF VARIANT
    JVARI_DESC-REPORT = SY-REPID.
    JVARI_DESC-VARIANT = P_VAR.
    JVARI_DESC-ENAME = 'EXAMPLES'.
    JVT-REPORT = SY-REPID.
    JVT-VARIANT = P_VAR.
    JVT-LANGU = SY-LANGU.
    JVT-VTEXT = 'FUNCTION EXAMPLES'.
    APPEND JVT.
    CLEAR SELPA.
    SELPA-SIGN = 'I'.
    SELPA-OPTION = 'EQ'.
    SELPA-KIND = 'P'.
    SELPA-SELNAME = 'P_VAR'.
    SELPA-LOW = P_VAR.
    APPEND SELPA.
    CHECK IF VARIANT EXISTS
    CALL FUNCTION 'RS_VARIANT_EXISTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    R_C = RC
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NO_REPORT = 2
    REPORT_NOT_EXISTENT = 3
    REPORT_NOT_SUPPLIED = 4
    OTHERS = 5.
    IF RC = 0 AND SY-SUBRC EQ 0.
    DELETE OLD VARIANT
    CALL FUNCTION 'RS_VARIANT_DELETE'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    FLAG_CONFIRMSCREEN = 'X'
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NOT_EXECUTED = 2
    NO_REPORT = 3
    REPORT_NOT_EXISTENT = 4
    REPORT_NOT_SUPPLIED = 5
    VARIANT_LOCKED = 6
    VARIANT_NOT_EXISTENT = 7
    NO_CORR_INSERT = 8
    VARIANT_PROTECTED = 9
    OTHERS = 10.
    IF SY-SUBRC NE 0.
    WRITE: 'UNABLE TO DELETE VARIANT:', P_VAR ,'STATUS=', SY-SUBRC.
    EXIT.
    ELSE.
    WRITE:/ P_VAR, 'DELETED'.
    ENDIF.
    ELSE.
    WRITE:/ P_VAR, 'DOES NOT EXIST'.
    ENDIF. " ALREADY EXISTS
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    CURR_REPORT = JVARI_DESC-REPORT
    CURR_VARIANT = P_VAR
    VARI_DESC = JVARI_DESC
    TABLES
    VARI_CONTENTS = SELPA
    VARI_TEXT = JVT
    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 0.
    WRITE:/ 'VARIANT', P_VAR, 'CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    ELSE.
    WRITE:/ 'VARIANT', P_VAR, 'NOT CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    EXIT.
    ENDIF.
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    TABLES
    VALUTAB = PARMS
    OBJECTS = OBJS
    EXCEPTIONS
    VARIANT_NON_EXISTENT = 1
    VARIANT_OBSOLETE = 2
    OTHERS = 3.
    IF SY-SUBRC NE 0.
    WRITE : / 'ERROR READING VARIANT CONTENTS.'.
    ELSE.
    CALL FUNCTION 'RS_VARIANT_TEXT'
    EXPORTING
    LANGU = SY-LANGU
    CURR_REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    V_TEXT = VARIANT_TEXT.
    WRITE:/ 'VARIANT DESCRIPTION:', VARIANT_TEXT.
    LOOP AT PARMS.
    CHECK PARMS-LOW NE SPACE OR PARMS-HIGH NE SPACE.
    READ TABLE OBJS WITH KEY NAME = PARMS-SELNAME.
    WRITE : /2 PARMS-SELNAME, OBJS-TEXT,
    45 PARMS-KIND,
    PARMS-SIGN,
    PARMS-OPTION,
    PARMS-LOW,
    PARMS-HIGH.
    NEW-LINE.
    ENDLOOP.
    SKIP.
    ENDIF.
    some other approach....
    This function module selects the Selection Screen contents
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    curr_report = sy-repid
    TABLES
    selection_table = loc_int_tab
    EXCEPTIONS
    not_found = 1
    no_report = 2
    OTHERS = 3.
    IF sy-subrc NE 0.
    MESSAGE i000 WITH 'Error in RS_REFRESH_FROM_SELECTOPTIONS'(029).
    LEAVE LIST-PROCESSING.
    ENDIF.
    Craete the variant VAR1
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    curr_report = sy-repid
    curr_variant = wf_variant
    vari_desc = loc_varid
    TABLES
    vari_contents = loc_int_tab
    vari_text = loc_varit
    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 <> 0.
    MESSAGE i000 WITH 'Error while creating dynamic variant'(028).
    LEAVE LIST-PROCESSING.
    ENDIF.
    reward point if helpful.
    thanks
    mrutyun^

  • Variants, Dynamic Value, Dynamic Variants

    How do I create a dynamic variant in ECC 6.0. I'm aware of the steps in 3.X and 4.X environments. Any help will be highly appriciated. Thanks in advance.

    Please find below procedure to define the dynamic variant in ECC6.0
    Step 1:  Go to SE38, Enter the program u2013 RBDAPP01 (Program to process inbound IDocs) and click on execute button.
    Step2: Enter message type u201CMATMASu201D and Click on the save button
    Step 3: To create dynamic value for Created on field, Click on Selection variable for u201CCreated Onu2019 Filed
    The F4 for the selection variable shows the following options.
    T u2013 Table Variable for TVARVC
    D u2013 Dynamic data calculation.
    Select D u2013 Dynamic data calculation.
    Step 4 : Click on u201CName of the Variable (Input only Using F4) column row for the u201CCreated onu201D field.
    F4 option for the u201CName of Variable u201Cprompts to select I/E, Option & Variable Name.
    Choose the variable name as u201CCurrent data u2013xxx,Current data + YYYu201D and click on ok button.
    Following screen prompts to enter the value. Enter u201C7u201D for the u201Ca values for xxxu201D and 0 for u201Ca value for yyyu201D. As shown in below screen.
    Save the variant.
    Go back to report selection screen and select variant name as created above.

  • Diifernece b/w varinats & dynamic variants

    Hello Abapers,
    Could you guys help me out in explaining the diff b/w variant & dynamic variant ...where it is used in what scenarios...
    it will be appreciated with lots of points if you cld able to explain with an example.
    awaiting for your replies....
    Regards,
    Ravi V Ganji

    Hi,
    <b>Varinats</b>
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/62/2e5ed7f50d2d4085c1d6bed67b24c0/frameset.htm
    <b>Dynamic Variants:</b>
    Dynamic varaints possible in 2 ways.
    - Dynamic declaration by System defined variables
    - Dynamic declaration by custom defined variables
    the first one is defined by the variant management screen. The second one is defined using STVARV and STVARC tcode.
    In STVARV you define a variable which will be available as drop down in the varaint management screen.
    Please follow these steps:
    1. Enter the values in the selection screen
    2. Save the variant using the SAVE button
    3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.
    4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (ie. D - Dynamic date calculation).
    5. Click on the down arrow button and select the option 'Current Date'.
    6. Save the variant.
    Reward if it helps
    Regards,
    Santosh

  • Regarding dynamic variants

    Hi all ,
          i have code where i have created a selection screen.
          like :
    <code>
    DATA: v_date TYPE sy-datum,
          v_next TYPE sy-datum.
    SELECT-OPTIONS: s_date1 FOR v_date,
                    s_date2 FOR v_date.
    INITIALIZATION.
      s_date1-low  = sy-datum + 1.
      s_date1-high = s_date1-low + 60.
      APPEND s_date1.
      s_date2-low  = s_date1-high + 1.
      CALL FUNCTION 'MONTH_PLUS_DETERMINE'
        EXPORTING
          months  = '6'
          olddate = s_date2-low
        IMPORTING
          newdate = s_date2-high.
      APPEND s_date2.
    START-OF-SELECTION.
    </code>
    i want to create dynamic variants , how to create that and can anyone suggest any function module.
    regards,
    karan

    Please follow these steps
    1. Enter the values in the selection screen
    2. Save the variant using the SAVE button
    3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.
    4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (ie. D - Dynamic date calculation).
    5. Click on the down arrow button and select the option 'Current Date'.
    6. Save the variant.
    Also check the thread.
    Dynamic Variants

  • Creating dynamic variant on Period field in transaction MC$4

    Hi,
    I would like to create dynamic variant for field 'period' on the selection screen of tcode : MC$4.
    I would like to create a variant for the logic: current period - 12 months.
    I am able to do this on the date field in the variant as its defined using data element datum. Thus it allows me calculation.
    But the period filed in the sel. screen has NUMC type so not able to do any dynamic variants for this filed.
    Please help if anyone has any info on this.
    Helpful replies will be awarded.
    Thanks,
    Husain

    Any inputs will be appreciated...

  • How to set up Dynamic Variants for job which is based on Pay Period

    Hi,
    We need to set up dynamic variant for payroll interface.  This interface is based on Pay periods and that is why we need to use different variant for each month.  Letus know how to set up dynamic variant which will take care of Pay Periods

    Hi,  Thnx for reply.
    We are not changing the control records, current period will be some old period in system. 
    payroll is not processed in SAP,

  • Creating a transaction code for variant type in se93

    hai all,
    i created transaction's for dialogue type and report type,now i am trying to create transaction for variant type. in that what we have to provide in transaction text box where the f4 functionality is provided for that text box.
    could any one plz help me out.
    Thanks in Advance.

    Hi,
    U need to create transaction variant in SHD0 transaction before creation transaction by variant.
    Go thru the following link carefully.
    Certainly it will be helpful to you.
    http://www.mortenhjorthnielsen.dk/Security/transactionvariants.htm
    Regards
    Vadi

  • How do you save dynamic data type, from the DAQ assistant, for use in Excel or matlab?

    Currently, I have the following basic VI setup to save Data from my PCI6221 Data Aquisition Card.  The problem I'm having is I keep getting the last iteration of the while loop in the measurement file and that's pretty much it.  When I try to index the data leaving the loop it gives me a 2D array of Data which cannot be input into the "Write to Measurement File" VI.  How would I save this to a useful Data/time step format?  I was wondering of a way to continuously collect the Data and then save it in a large measurement file that I would manipulate in Matlab/excel?  Am I using the wrong type of loop for this application?  I also noticed my Dynamic Data array consists of data, time, timestep and then a vector of the data taken.  Is it possible to just get a vector of the time change per sample alongside the data?    Sorry for the barrage of questions but any help would be greatly appreciated, and thanks in advance!
    -Bryan
    Attachments:
    basic DAQ.vi ‏120 KB

    There is a VI in the Express > Signal Manipulation palette called "From DDT" that lets you convert from the Dynamic Data Type to other data types that are more compatible with operations like File I/O....for instance, you could convert your DDT into a 2D array and use the Write To Spreadsheet File.vi.  Just a thought...
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Using dynamic variants in ABAP

    Hi,
    I have an issue. I want to use dynamic variants in my program. On the selection screen of my program, I have a parameter called Planning date which takes in the current week of the year as input value, i.e lets say today we are Monday 14th of May 2007, so the current week is 20. I want to make this parameter dynamic, i.e to change automatically so that next week the value is week 21.
    Also is setting dynamic variants version dependent? My version is 5.0 SR1 and I don't have the option of save my variant using the 'D' traffic signal.
    Please help me out.
    Thanks

    Hi,
    you can fill your parameter in the initialization event of your report. In order to get the week you can use the function DATE_GET_WEEK.
    Kostas

  • RFC call from Delphi (Bad Variant Type error)

    Well, I'm trying to call an RFC function from Delphi via ActiveX objects..
    I have Codegear 2009 installed and it works without any problem..
    But on another system with Delphi7 installed when I ran same code it gives "Bad Variant Type" error when assigning SapLogonControl's connection object to SapFunction's connection parameter... Both computers have same SAP installation. And on both systems ActiveX objects imported correctly on Delphi.
    Here is the code:
    unit logon1;
    interface
    uses
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    ExtCtrls, OleCtrls, StdCtrls, SAPFunctionsOCX_TLB,
    Grids, SAPLogonCtrl_TLB;
    type
      TForm1 = class(TForm)
      SAPFunctions1: TSAPFunctions;
      Button2: TButton;
      Grid: TStringGrid;
      Edit1: TEdit;
      Edit2: TEdit;
      Label1: TLabel;
      Label2: TLabel;
      SAPLogonControl1: TSAPLogonControl;
    procedure Button2Click(Sender: TObject);
    private
    { Private-Deklarationen }
    public
    { Public-Deklarationen }
    end;
    var
    Form1 : TForm1 ;
    Table, Funct, Connection : VARIANT ;
    implementation
    {$R *.DFM}
    procedure TForm1.Button2Click(Sender: TObject);
    begin
      Connection                  := SAPLogoncontrol1.newConnection;
      Connection.User             := 'testuser';
      Connection.System           := 'CRD';
      Connection.Client           := '300';
      Connection.ApplicationServer:= '10.1.1.10';
      Connection.SystemNumber     := '00';
      Connection.Password         := 'testpass';
      Connection.Language         := 'EN' ;
      if Connection.LogOn(0,true) = true then
      (* parameter "true" = SilentLogOn *)
      begin
        (* assign the existing connection to the *)
        (* component SAPFunctions1                *)
        SAPFunctions1.Connection := Connection; // It gives error on this line...
        Funct := SAPFunctions1.add('ZGIS_TEST_FUNC');
      end;
    end;
    end.
    As I said while Codegear 2009 runs this code without any problem, Delphi 7 crashes on that assignment.. Also I tried outside Delphi, and the file compiled with Codegear works on both systems while the file compiled with Delphi 7 again crashes on buth systems...
    Is there a problem with Delphi 7? Should I use at least Delphi 8 or something for compiling?

    Hi Hakan,
    You must use Non-Unicode RFC library for Delphi 7.0.
    ( Bende Delphi 7.0 kullaniyorum. Ayni hatayi aldim. Unicode library kullanmistim. Kaldirip Non-Unicode olani kullandim. Su an hata yok. RFC cagirabiliyorum. )
    Mustafa Yalcin

  • How to create a multipage PDF with same template but dynamically varying data?

    Hello,
    I need to create a multi-page PDF where I need to use the same template but dynamically varying data.
    Eg Scenario:
    1. I have data for 5 material in my ABAP program.
    2. I have a PDF template in SFP which has a 2 page structure.
    3. Based on the number of materials (5 in this case), I need to generate a PDF which will have 10 pages (2 for each material).
    4. the generated PDF should be like the one shown below:
    e.g.  MATERIAL_PDF (pdf name)  
          |  Page1(Mat1[View1].data)
          |  Page2(Mat1[View2].data)
          |  Page3(Mat2[View1].data)
          |  Page4(Mat2[View2].data)
          |  Page5(Mat3[View1].data)
          |  Page6(Mat3[View2].data)
             .. and so on...
    Thanks,
    Aniket

    Isn't it just by setting the two pages into a form ( like an subform in the content ) and put the settings in a proper way?
    There is this setting, that the masterpage comes up everytime the pagecount is done.
    Example
    Page 1 3 5 --> Masterpage 1
    Page 2 4 6 --> Masterpage 2
    And the designview with the flowing data, you can do it by scripting to get to the next page after the pos is finished.
    Unfortunaly I do not got a system atm, so I hope the explaination give you a clue, where to search.
    Regards
    Florian

Maybe you are looking for

  • Command linux help

    Hi gurus! This may be a silly question, but since i have googled and i still cant find a solution i come to you. My problem is that i need no find in different directories .ear files (find . -name *.ear) and with the output (or somehow) i need to vis

  • Java HotSpot [jsoundds.dll+0x2231] Error

    When I am playing games on Pogo often the game will just close and this error on a notepad appears: # An unexpected error has been detected by HotSpot Virtual Machine: # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d4a2231, pid=3652, tid=1564 # J

  • IPhoto install problems

    I am trying to install iPhoto 6.0.4 from 4 and I get an error message that it cannot find the iPhoto application to upgrade, which of course is there in Applications. Any ideas?

  • [help] ram usage

    Sorry for my horrible english. Anyway, today i try safary 3.1 on Xp sp2 pro. With freemeter and task manager, i see a strange behaviour for a web browser. The Ram utilization growth if i visit many web pages. 150mb 200mb 300mb This is a bug of safary

  • Beginner Website Tutorials do not match CS5.5 or CS6. Why?

    It is impossible to get through the basic tutorials provided to show how to create a website, etc. Has anyone actually tried it? The information does not match current Dreamweaver CS6 or even earlier Dreamweaver CS5.5, at least on the Mac software ve