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

Possible entries, unique

Former Member
0 Likes
1,732

how to give possible entries to particular fields

and also how to make the field unique.

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,686

Hi,

So using the table maintenance..The table values will be updated??Right??

For the sequence number..Create the number range as I mentioned above..

You might have to use events in the table maintenance to automatically populate the next number in the sequence..

Please reward points for helpful answers..

Thanks,

Naren

15 REPLIES 15
Read only

Former Member
0 Likes
1,686

Hi,

Check the example..For adding F4 help..

TABLES: T005T.

DATA: BEGIN OF t_t005 OCCURS 0,

land1 TYPE t005-land1,

END OF t_t005.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(6) v_text FOR FIELD P_LAND1.

PARAMETERS: p_land1 TYPE t005-land1.

SELECTION-SCREEN COMMENT 13(35) v_text1.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

v_text = 'Country'.

v_text1 = ' '.

AT SELECTION-SCREEN OUTPUT.

IF NOT p_land1 IS INITIAL.

SELECT SINGLE * FROM t005t

WHERE spras = sy-langu

AND land1 = p_land1.

IF sy-subrc = 0.

v_text1 = t005t-landx.

ENDIF.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_land1.

REFRESH: t_t005.

SELECT land1

INTO TABLE t_t005

FROM t005.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'T005'

PVALKEY = ' '

retfield = 'LAND1'

dynpprog = sy-repid

DYNPNR = sy-dynnr

dynprofield = 'P_LAND1'

callback_program = sy-repid

value_org = 'S'

TABLES

value_tab = t_t005

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks,

Naren

Read only

Former Member
0 Likes
1,686

Hi Hema,

If in your program, you have declared your selection screen variable referencing a DDIC type, and if the DDIC type is associated iwth a check table or a search help, then the search help should be automatically available to you in your program.

Eg.,

select-options:

abc for mara-matnr.

If this is not the case, then ofcourse you can populate the values into an internal table and then call the FM F4IF_INT_TABLE_VALUE_REQUEST.

Rgds,

Prashanth.

SAP India.

Read only

0 Likes
1,686

I have nt gone to program I'm in Table creation only

in a table for fields

ebelp

menge

brix

bwart

werks

inspso

I have to show possible entries when pressed on them

Read only

Former Member
0 Likes
1,686

Hi,

OR

If you have a table name and field name you can use that..

Example.

PARAMETERS: P_VBELN TYPE VBAK-VBELN.

IT will pull the search help automatically..

OR

You can use the match code addition..

Example

PARAMETERS: P_VBELN TYEP VBAK-VBELN MATCHCODE OBJECT VMVA.

Thanks,

Naren

Read only

Former Member
0 Likes
1,686

Hi,

For which field you want to have the F4 help..

THanks,

Naren

Read only

0 Likes
1,686

ebelp

menge

brix

bwart

werks

inspso

Read only

Former Member
0 Likes
1,686

Hi,

When you create the table..You can give a foreign key to the tables mentioned below for each field..So that it will automatically give a possible entries..

ebelp - <b>Not sure</b>

menge - <b>Generally for quantity field you will not get possible entries</b>

brix - <b>Give a description about this field.</b>

bwart - <b>T156</b>

werks - <b>T001W</b>

inspso - <b>Give a description about this field.</b>

Thanks,

Naren

Read only

0 Likes
1,686

brix is a qty field so no need

inspso is a base unit of measure

and one more thing how to create value table or where in domain we can mention

and for a field which was created by me( is abt sequence number ) I have to make it unique field means if same number is entered again it must not take.

Read only

Former Member
0 Likes
1,686

Hi,

For base unit of measure use the table T006.

Also to define the foreign key..Do the following..

1)

Use the standard sap data element for the fields...This will make easier to define the foreign key.

I have mentioned the data elements for the three fields..

bwart - BWART

werks - WERKS_D

inspso - MEINS

2) Now you have the fields and the correct data elements..

Place the cursor on the field ..let's say BWART..

Press the foreign key button..in the menu..GOTO -> FOREIGN KEY(S)..

Then you will a get message saying..

"

Foreign key does not exist.

Create a proposal with values table T006 as check table ? "

Press Yes button ..Then automatically the relationship is defined..

Press copy button..

Save and activate..

Do the same for other fields also..

Now you will get F4 on the field..

Thanks,

Naren

Read only

0 Likes
1,686

is foreign key creation and value table same

and for a field which was created by me( is abt sequence number ) I have to make it unique field means if same number is entered again it must not take.

Read only

Former Member
0 Likes
1,686

Hi,

Check table defines the foreign key for that field value..Example..for BWART..If you enter a value which is not in the table T156..It will give an error..

Value table will not do the foreign key check..

But the system proposes the value table as check table when you try to define a foreign key for this field.

For number sequencing you can create a number range object and interval in the transaction SNRO..And use the function module NUMBER_GET_NEXT to get the next number available..

B.T.W ..

How this new table will be inserted with new records..Is it through SM30??

Thanks,

Naren

Read only

0 Likes
1,686

table maintenace is already done with just 2 fields by other guy now I'm adding new fields and some existing fields tro it

Read only

Former Member
0 Likes
1,687

Hi,

So using the table maintenance..The table values will be updated??Right??

For the sequence number..Create the number range as I mentioned above..

You might have to use events in the table maintenance to automatically populate the next number in the sequence..

Please reward points for helpful answers..

Thanks,

Naren

Read only

0 Likes
1,686

rt now I'm working with table only I havent started the program so how can i use events

Read only

Former Member
0 Likes
1,686

Hi,

Check in the following link for the post done by me for getting the next number and using it in SM30.

https://forums.sdn.sap.com/click.jspa?searchID=576841&messageID=2653243

Check in the following links for the posts done by me..This is regarding the SM30 events..

https://forums.sdn.sap.com/click.jspa?searchID=576813&messageID=2403945

https://forums.sdn.sap.com/click.jspa?searchID=576813&messageID=2841130

Thanks,

Naren