cancel
Showing results for 
Search instead for 
Did you mean: 

read master data variable values in fox before executing the layout

Former Member
0 Kudos

Hello,

I do have a requirement that if a user picks up a customer which do not have any account group assigned, the layout cannot be plannable. Account grp is an attribute of customer.I kept this function under function attribute before layout display. It is not giving any message if the selected combination of the variables in the planning data do not have any data. The user should get a message even before the data is entered.

My basic understanding is that the below function is reading thru transaction data and is not reading the variable values before opening the planning layout under planning folder.

Any suggestions.. Your help is greatly appreciated.

Thanks,

-


Code is below------

DATA CUSTOMER TYPE 0CUSTOMER.

DATA ACCOUNTGRP TYPE ZKATR3.

CUSTOMER =VARV(CUSTOMER).

ACCOUNTGRP =ATRV(ZKATR3,CUSTOMER).

DO.

IF ACCOUNTGRP = #.

MESSAGE E003(/SEM/001) WITH '*** CUSTOMER NOT PLANNABLE:*'.

EXIT.

ENDIF.

ENDDO.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey,

can you tell a little more how you want to use your coding ? I mean is it a fox formula and when it is the case when and how do you execute this function ? And even if you have the right coding, how will you set the accountgrp for a customer that has none assigned ?

Genenrally your coding (if it will be executed by a fox formular) will check the value of the global variabel 'customer', checks the value of the named attribute. But I think your loop is not 100% right. You have to put the exit statement outside your if statement because if the accountgrp != # it will be an endless loop.

Former Member
0 Kudos

I need to display a message when the user enters the variable and try to open the planning layout.

what I did is I kept a planning function before displaying the layout so that the function runs picks up the variable from customer, gets the attribute value of account group and displays the message.

If the account group has some value, then it bypasses and opens up the planning layout.