Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to set BDCDATA table for a SELECT-OPTIONS object?

Former Member
0 Likes
4,314

Dear experts,

I have a transaction with PARAMETERS and SELECT-OPTIONS objects. This transaction will be called by another program by using CALL TRANSACTION 'mytransaction' USING mybdcdata statement. Below is some of the called transaction's source code:


DATA:
  date TYPE sflight-fldate.
 
PARAMETERS:
  p_carid TYPE sflight-carrid,
  p_conid TYPE sflight-connid.
 
SELECT-OPTIONS:
  so_date FOR date.

This is what I wrote in the calling program to define the values of the called transaction PARAMETERS fields:


DATA:
  wa_bdcdata TYPE bdcdata,
  it_bdcdata TYPE TABLE OF bdcdata.
 
wa_bdcdata-program = 'MYPROGRAM'.
wa_bdcdata-dynpro = '1000'.
wa_bdcdata-dynbegin = 'X'.
 
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
 
wa_bdcdata-fnam = 'P_CARID'.
wa_bdcdata-fval = 'AA'.
 
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
 
wa_bdcdata-fnam = 'P_CONID'.
wa_bdcdata-fval = '017'.
 
APPEND wa_bdcdata TO it_bdcdata.
 
CALL TRANSACTION 'MYTRANSACTION' USING it_bdcdata.

Unfortunately, I don't know how to set the values for the SELECT-OPTIONS screen fields. How to do this?

I've Googled this and tried several guesses but none was found or successful. Thanks in advance.

Regards,

Haris

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,095

you would supply the field name like s_option-low s_option-high, etc.

A better way, if possible, would be to set parameter ids to a value and call the transaction skipping the first screen. This may not be possible, though, in your case.

If you have developed a report, record the session (bdc recorder) to the point when it is past your selection screen...the recording will show you the fields, screen actions, etc.

you would supply the field name like s_option-low s_option-high, etc.

A better way, if possible, would be to set parameter ids to a value and call the transaction skipping the first screen. This may not be possible, though, in your case.

If you have developed a report, record the session (bdc recorder) to the point when it is past your selection screen...the recording will show you the fields, screen actions, etc.

6 REPLIES 6
Read only

Former Member
0 Likes
2,096

you would supply the field name like s_option-low s_option-high, etc.

A better way, if possible, would be to set parameter ids to a value and call the transaction skipping the first screen. This may not be possible, though, in your case.

If you have developed a report, record the session (bdc recorder) to the point when it is past your selection screen...the recording will show you the fields, screen actions, etc.

Read only

0 Likes
2,095

If you program is a report it would be much easier to use the SUBMIT statement instead of a CALL TRANSACTION.


  SUBMIT 'your_report' WITH p_param = value
                                 WITH s_sel   IN values
                       AND RETURN.

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,095

Hi Haris,

If you have fixed values in your selection screen, I suggest you to create a program variant and call/create a transaction with this variant

If these values are determined at runtime, then you could create a Z transaction which calls the program the way suggested by Arseni Gallardo, and you call the Z transaction in batch input.

Other solution, you can use this simple framework which fills the SELECT-OPTIONS for you, I just posted it in this wiki : http://wiki.sdn.sap.com/wiki/display/ABAP/FillSELECT-OPTIONSin+BDCDATA

Sandra

Read only

Former Member
0 Likes
2,095

Hello,

Please use this code for the purpose, I am sure you must have get the relavant help in that relation:

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-102.

PARAMETERS: p_fmode RADIOBUTTON GROUP r1,

p_bmode RADIOBUTTON GROUP r1.

SELECTION-SCREEN END OF BLOCK b3.

START-OF-SELECTION.

PERFORM data_upload.

END-OF-SELECTION.

Thanks & Regards,

Akg

Read only

Clemenss
Active Contributor
0 Likes
2,095

Hi Haris,

select-options fields can be referred to as SO_DATE-LOW and SO_DATE-HIGH.

If you want extended selections, it gets a bit more tricky as you use function code and have one more screen with tabs and stuff.

You can still run batch recorder to answer such basic question.

BTW: akg.amit post seems to be completely misrouted as there is no reference to the question at all.

Regards

Clemens

Read only

0 Likes
2,095

Hi ,

Better go for SUBMIT report instead of CALL transaction ...

find the name of report being called on that transaction which you will be calling . Use that report name in SUBMIT

Just take help from below code .

Before using do please read  by pressing f1 on SUBMIT  syntax .

data:seltab type table of rsparams,

seltab_wa like line of seltab.

move: 'LANGU' to seltab_wa-selname,

'S' to seltab_wa-kind,

'I' to seltab_wa-sign,

'BT' to seltab_wa-option,

'D' to seltab_wa-low,

'I' to seltab_wa-high.

append seltab_wa to seltab.

clear seltab_wa.

move: 'E' to seltab_wa-sign,

'EQ' to seltab_wa-option,

'F' to seltab_wa-low,

space to seltab_wa-high.

append seltab_wa to seltab.

clear seltab_wa.

move: 'AUFNR' to seltab_wa-selname,

p_aufnr to seltab_wa-low.

append seltab_wa to seltab.

clear seltab_wa.

submit rkaep000 using selection-set 'VARIANT1'

with aufnr = p_aufnr

with selection-table seltab

exporting list to memory

and return .

regards

Deepak.