Application Development 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: 

select options

Former Member
0 Kudos

Hello Gurus,

I am presently working for SAP implementation project.

i just want to understand if i can assign a work area for a select option.

In my program i need to assign an internal table to select option.

In SAP ecc 6.0 Occurs 0 will become obsolete.

so i ve used only Internal table with initial size 0.

If i try to assign this internal table for select option it gives me a syntax error : internal table is without header line.

If i assign the same workarea of that table it accepts.

Is this the correct way.

can i assign a work area for a select option.

will it work properly.Because we dont have test data also to test our code at present.

Anyone pls help me to find it out.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Yes you can , can you explain why your doing that so we can suggest better.

10 REPLIES 10

Former Member
0 Kudos

Yes you can , can you explain why your doing that so we can suggest better.

0 Kudos

Hi

I am working in C2C module.this program is basically an inbound interface program.

here i need to get the branch details from the user which is used as a select-option field with no intervals.

The branch details are stored in an Internal table IT_branch

as we r working in SAP ECC 6.0 i cannot create int tables with occurs 0, so i ve declared an explicit work area for this table wa_branch

Is it correct to use a work area in select options.

I want to understand how the records present in this internal table will be acccessed completely if i assign only a work area of that table to select option

0 Kudos

As i told earlier you can declare WA of select option type loop and move it WA and play around , Record will be accessed properly with out headerline for select options you need not worry.

Loop at IT_branch where werks in so_werks.

endloop.

The above statement will work.

0 Kudos

Hi karthik,

pls could you refine your reply and give the correct format for looping around the select option.

this is the way in i ve declared the select option.

types : begin of ty_branch,

branch type char25, "Branch Names

end of ty_branch,

data : it_branch type standard table of ty_branch initial size 0,

data : wa_branch like line of it_branch,

select-options: s_brnchs for wa_branch-branch no intervals.

your reply will be greatly rewarded.

Thanks,

padmini

0 Kudos

Hi

Do like this.

REPORT ztest.

TYPES : BEGIN OF ty_branch,
  branch TYPE char25, "Branch Names
END OF ty_branch.

DATA : it_branch TYPE STANDARD TABLE OF ty_branch INITIAL SIZE 0.

DATA : wa_branch LIKE LINE OF it_branch.

SELECT-OPTIONS: s_brnchs FOR wa_branch-branch NO INTERVALS.

** << Populate values for IT_BRANCH >>

LOOP AT it_branch INTO wa_branch.
  s_brnchs-option = 'EQ'.
  s_brnchs-sign = 'I'.
  s_brnchs-low = wa_branch-branch.
  append s_brnchs.
ENDLOOP.

Former Member
0 Kudos

Hi Padmini,

In ECC 6.0 header lines are not supported because of Object Orientedness, so you need to create internal tables with out header lines and need to use explicit work area to perform operations.

Thanks,

Vinay

Former Member
0 Kudos

Hi padmini .

with Select-option one Internal table will be created with low , high , Sign and option as its Fields , not work area .

if You want to assin / Pass selct -options during run time , you have to declare one Range and append the same values and you can use the range variable ( internal Table ) for the purpose .

Hope it is clear for you ., if not please let me know Your exact requirement .

thanks

Sreenivas Reddy

Former Member
0 Kudos

Hi,

Program giving you the error "internal table is without header line." because, when you define a select-option it will be acted like an internal table without header line. It's structre is

sign type char1

option type char2

low type <select-option type>

high type <select-option type>

So you need to create a structure with the above fields and you need to append the data line by line into select-option.

Thanks,

srini,

0 Kudos

Hi srini

Thanks for your reply..

could u pls give the exact format for that..

Ur reply will be greatly apppreciated and rewarded

0 Kudos

Hi,

AS told by sree, select option's IT has four fields. you have to define a range like this for it:

  • daclaration of Ranges.

DATA : range_Vendor_No TYPE RANGE OF LIFNR,

wa_r_Vendor_No LIKE LINE OF r_Vendor_No.

if <select-option>-low is not initial or <select-option>-high is not initial.

wa_r_Vendor_No-SIGN = 'I'.

wa_r_Vendor_No-low = <select-option>-low .

wa_r_Vendor_No-high =<select-option>-high .

IF wa_r_Vendor_No-low IS NOT INITIAL AND wa_r_Vendor_No-high IS NOT INITIAL .

wa_r_Vendor_No-option = 'BT'.

ELSE.

wa_r_Vendor_No-option = 'EQ'.

ENDIF.

Append wa_r_Vendor_No to range_Vendor_No.

Endif.

Thus u can use this range as an Internal table.

Hope It helps you.

Thanks and Regards

- Rishika Bawa