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

POPUP_GET_VALUES how to validate data

Former Member
5,525

Hi everyone,

I am using the FM POPUP_GET_VALUES, so the user can insert the company code. I would like that the FM validate if the company code really exists.

I am using this code:

 field-tabname = 'T001'.
    field-fieldname = 'BUKRS'.
    dield-field_obl = 'X'.
    APPEND field.

CALL FUNCTION 'POPUP_GET_VALUES'
  EXPORTING
    no_value_check        = 'X'
    popup_title           = w_title
  IMPORTING
    returncode            = w_retn
  tables
    fields                = field

I do not really get, the use of the import parameter, no_value_check because no matter the vallue it has it will not validate de company code I use.

Is there any way to validate the parameters I use in this FM?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
2,569

hi,

use POPUP_GET_VALUES_DB_CHECKED

POPUP_GET_VALUES_USER_CHECKED

POPUP_GET_VALUES_USER_HELP

you can check this link

http://help.sap.com/saphelp_nw04/helpdata/en/2a/f9fff0493111d182b70000e829fbfe/frameset.htm

thanks

Hi everyone,

I am using the FM POPUP_GET_VALUES, so the user can insert the company code. I would like that the FM validate if the company code really exists.

I am using this code:

 field-tabname = 'T001'.
    field-fieldname = 'BUKRS'.
    dield-field_obl = 'X'.
    APPEND field.

CALL FUNCTION 'POPUP_GET_VALUES'
  EXPORTING
    no_value_check        = 'X'
    popup_title           = w_title
  IMPORTING
    returncode            = w_retn
  tables
    fields                = field

I do not really get, the use of the import parameter, no_value_check because no matter the vallue it has it will not validate de company code I use.

Is there any way to validate the parameters I use in this FM?

Thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
2,569

Hi,

You can validate the company code after the exceution of the FM.

You cannot validate in the FM.

Regards,

Daz.

Read only

Former Member
2,570

hi,

use POPUP_GET_VALUES_DB_CHECKED

POPUP_GET_VALUES_USER_CHECKED

POPUP_GET_VALUES_USER_HELP

you can check this link

http://help.sap.com/saphelp_nw04/helpdata/en/2a/f9fff0493111d182b70000e829fbfe/frameset.htm

thanks

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,569

data:lv_code type BAPI0002_2-COMP_CODE.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

no_value_check = 'X'

popup_title = w_title

IMPORTING

returncode = w_retn

tables

fields = field.

if sy-ucomm = 'FURT'.

read table field index 1.

if sy-subrc = 0.

lv_code = field-value.

here use fm BAPI_COMPANYCODE_EXISTENCECHK pass lv_code and check whether the company code exists

endif.

endif.

Read only

0 Likes
2,569

I would like to thanks to everyone who responded.

I used the FM POPUP_GET_VALUES_DB_CHECKED and it worked just fine.

thanks