Skip to Content
author's profile photo Former Member
Former Member

the selection variant is not chosen automatically

After entering the project (see screenshot in attachment) the selection variant which is maintained in spro define launchpads for navigation is not chosen automatically:


I know it is a BDC program but how to program so that the selection variant is chosen automatically,


BDC program for reference -:


FORM bdc_transaction USING tcode.

DATA : lv_transaction_code TYPE sy-tcode,

lv_opt TYPE ctu_params..

REFRESH messtab.

lv_opt-dismode = 'E'.

lv_opt-updmode = 'L'.

lv_opt-nobinpt = 'X'.

lv_transaction_code = tcode.

CALL FUNCTION 'AUTHORITY_CHECK_TCODE'

EXPORTING

tcode = lv_transaction_code

EXCEPTIONS

ok = 0

not_ok = 1

OTHERS = 2.

IF sy-subrc = 0.

CALL TRANSACTION tcode USING bdcdata

* MODE 'A' "E'

* UPDATE 'L'

OPTIONS FROM lv_opt

MESSAGES INTO messtab.

ELSE.

MESSAGE i182(/cpd/cl_msg).

ENDIF.

LEAVE TO SCREEN 0.

ENDFORM. "BDC_TRANSACTION

*----------------------------------------------------------------------*

* Start new screen *

*----------------------------------------------------------------------*

FORM bdc_dynpro USING program dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM. "BDC_DYNPRO

*----------------------------------------------------------------------*

* Insert field *

*----------------------------------------------------------------------*

FORM bdc_field USING fnam fval.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDFORM. "bdc_field

Capture.PNG (94.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Nov 09, 2015 at 10:03 AM

    Hi Shubham,

    Use any of these function modules in addition to your already existing code snippet.

    LVC_VARIANT_DEFAULT_GET( or FYI:- REUSE_ALV_VARIANT_DEFAULT_GET ) and see to it that when you pass the value for I_SAVE parameter, you pass 'A' which means " standard and user-specific " option.


    I have done this extensively for ALV, setting the default selection screen variant and all. Give this a try, I am sure this will work out with a little bit of adjustment in your original code snippet.

    Best Regards,

    Naren K.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.