Skip to Content
avatar image
Former Member

Variant creation from ABAP program

Hi all,

I need to create a variant from the program . i know that we can use FM RS_CREATE_VARIANT to create a variant. but my problem is i am unable to create variant with free selections/Dynamic Selection .

Example : If I wan to pass value for dynamic fields in SAP FBL1N transaction from my program how can I do ?

I checked FM RS_REFRESH_FROM_SELECTOPTIONS but it is not returning dynamic section fields

Thanks,

Santosh.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Sep 25, 2017 at 11:16 AM
    -1

    Hi Rossi,

    Thanks for your time..

    I have checked above scn link. but I am not sure which structures we have to fill and in below function module in table parameters it is mentioned that date fields but I have to pass normal fields like "vendor country" (FBL1N report dynamic field). can you provide any sample program.

    RS_VARIANT_VALUE_SAVE

    Add comment
    10|10000 characters needed characters exceeded

    • I already answered that there was a sample code in the thread mentioned above, which was for condition SPFLI-CONNID = '0003' AND SPFLI-DEPTIME = sy-uzeit, but of course you need to indicate the technical name of the vendor country field (press F1 on the screen field).

  • Sep 25, 2017 at 04:52 AM

    FM : RS_CREATE_VARIANT

    in above fm user table parameter : VARI_CONTENTS LIKE RSPARAMS

    for this pass select-option or parameter using by S / P and values.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Krishna Murthy,

      Thanks you for your time.

      As you mentioned in this parameter ( VARI_CONTENTS LIKE RSPARAMS ) we are passing values for the normal selection fields.

      where as for dynamic selection fields we don't have field names(fields declared dynamically), so how can we pass this dynamic fields in RS_CREATE_VARIANT function module ?

      Thanks,

      Santosh.

  • Sep 25, 2017 at 08:01 AM

    This has been answered in this thread, with an sample code: https://answers.sap.com/questions/198724/changing-field-values-in-free-selections-multiple.html

    (you have to update the dynamic parameters after the variant has been created, using the function module RS_VARIANT_VALUE_SAVE)

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 27, 2017 at 06:40 AM

    Hi Rossi,

    Now I am able to pass dynamic selection fields in variant which are already selected as a default. my transaction is FBL1N

    Once dynamic selection fields values are copied using RS_VARIANT_VALUE_SAVE function module existing selection field values are cleared.

    Can you tell me how can we change variant without disturbing existing selection fields data.

    Regards,

    Santosh.

    Add comment
    10|10000 characters needed characters exceeded