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: 

FM G_SET_GET_ALL_VALUES

Former Member
0 Kudos

hey guys

i have one more question to ask.

i want to check whether the input parameter Business Area value exists in table or not thru FM G_SET_GET_ALL_VALUES

Used code is below.

parameter:p_gsber2 like bseg-gsber obligatory.

I called FM> in AT SELECTION-SCREEN Part,is it correct or not? because i want to display error in same input screen.

could you pls help me

how to use this FM in this case.

if i use FM as below i can get table list containing company code 200 with All Biz Areas.but in which way input parameter links with This FM.

CLIENT

FORMULA_RETRIEVAL

LEVEL 0

SETNR BR_200

VARIABLES_REPLACEMENT

TABLE TGSB

CLASS 0000

NO_RW_INFO

NO_DESCRIPTIONS

ambichan.

Message was edited by: ambi chan

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

Hi,

try at first this:

REPORT zforum12 .

PARAMETERS p_gsber LIKE bseg-gsber.
AT SELECTION-SCREEN ON p_gsber .

  SELECT COUNT( * )  FROM  tgsb  INTO sy-dbcnt
         WHERE  gsber  = p_gsber.

  IF sy-dbcnt <> 1.
    MESSAGE e000(fb) WITH 'pls enter correct b-aerea!'.
  ENDIF.

regards Andreas

6 REPLIES 6

Former Member
0 Kudos

Hi,

If you just want to check for the existance of business area, you can issue a SELECT on table TGSB against field GSBER. AT-SELECTION-SCREEN is the correct place to write your code.

Regards

0 Kudos

hey

sorry for my poor explanation.

i have to check whether INPUT GSBER is exist or not using inputted company code and GSBER.

purpose is to check whether gsber exists in company codee 200.

ambichan.

Message was edited by: ambi chan

andreas_mann3
Active Contributor
0 Kudos

Hi,

try at first this:

REPORT zforum12 .

PARAMETERS p_gsber LIKE bseg-gsber.
AT SELECTION-SCREEN ON p_gsber .

  SELECT COUNT( * )  FROM  tgsb  INTO sy-dbcnt
         WHERE  gsber  = p_gsber.

  IF sy-dbcnt <> 1.
    MESSAGE e000(fb) WITH 'pls enter correct b-aerea!'.
  ENDIF.

regards Andreas

0 Kudos

hey

i am sorry, i retrieved the gsberlist into INternal table xtab using Company code with FM. now i want to check inputed gsber exist in Internal table or not.

how to check in internal table.

can u give example.

Message was edited by: ambi chan

Message was edited by: ambi chan

0 Kudos

Hi,

If you want to assign company and b-aerea

You've to create a Z-Table e.g. Z001

With fields:

Name    key   
Mandt   X
Bukrs   X
Gsber   X
…

And now you can check the use of the combination of company code / b-aerea

SELECT COUNT( * )  FROM  Z001 INTO sy-dbcnt
       WHERE  bukrs  = p_bukrs
       AND    gsber  = p_gsber.

Regards Andreas

0 Kudos

why below code is not working.

-


DATA:BEGIN OF GSBER_TAB occurs 0.

include structure RGSB4.

DATA:END OF GSBER_TAB.

read table gsber_tab with key from = p_bukrs binary search.

-


why the above read statement does not matches? "from" field in structure RGSB4 does not takes the value why? am i wrong somewhere.

could you pls confirm.

ambichan.