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: 

How to validate F4 values through program

Pmayank
Participant
0 Kudos

Hello Friends,

I'm working on 3rd party API where I have only the field name and its value information. Need to validate the value from the F4 list in SAP.

Have tried to use Tables DD08l, DD03n. But I'm not getting exact checktable and field information.

For example - I have Field called 'Region' and its checktable name is T005S. From where I will get to know the information T005S-BLAND. So i can pass the value and validate.

Regards,

Preeti

3 REPLIES 3

vijay_hariharan
Contributor

Depends on how many F4 helps do you require this for.. i doubt if the system can be so dynamic as to fetch the right field name etc.. From what i understand you should have a limited number of fields like this and should be able to reference from the table directly.. If the list is big then you'll probably have to maintain the mapping somewhere.. Additional question is whether the validation is happening within SAP or is the validation happening in the third-party(i assume SAP).. you may Edit the question and add further details to get further responses..

Regards,
Vijay

Pmayank
Participant
0 Kudos

Hi Vijay,

Thanks Vijay for your response.

I can have any number of fields. To maintain mapping i don't know where the list will get end. Looking for something dynamic and yes validation is happening within SAP (OData).

Regards,

Preeti

raymond_giuseppi
Active Contributor

Using ddic information

  • FM DDIF_FIELDINFO_GET will return a list of values or a control table name if available for a table/structure and field name.

Using the search help

  • From a field name and table/structure (or BAPI parameter), you can get a search help with F4IF_DETERMINE_SEARCHHELP (or BAPI_HELPVALUES_GET_SEARCHHELP).
  • From the returned search help, you can get a list of values with F4IF_SELECT_VALUES filtered with a selection in SHLP-SELOPT (or the BAPI_HELPVALUES_GET SELECTION_FOR_HELPVALUES parameter). Use the filter option to read the desired record and not the full range of values (which can be huge).