‎2007 Apr 14 7:35 AM
Dear All,
I am developing a function module with few screens. My busienss requirement is such that i need to use some standard Module code, not this call should be conditional, and should be called only for the first time when screen is loaded.
I can not use chain end chain conditions as i am not giving any field open to users to load data.
Please sugegst.
Thanks for your help.
Regards,
Sudhir
‎2007 Apr 14 7:51 AM
Hi,
As per my understanding, u can write those nodules in PBO of the screen and then set a flag variable 'Y', in the end of that modules.
and check a condition that if flag <> 'Y', then only that code is executed.
So firset time when the screen will be loaded , flag will not be y and that modules will be executed, but nest time those will not be executed.
Hope it helps.
Regards,
Sonika
‎2007 Apr 14 7:51 AM
Hi,
As per my understanding, u can write those nodules in PBO of the screen and then set a flag variable 'Y', in the end of that modules.
and check a condition that if flag <> 'Y', then only that code is executed.
So firset time when the screen will be loaded , flag will not be y and that modules will be executed, but nest time those will not be executed.
Hope it helps.
Regards,
Sonika
‎2007 Apr 14 8:10 AM
Can we out any logical (comparison statement ) expression on screen flow logic.
?
‎2007 Apr 14 8:30 AM
Hi,
we can write out any logical (comparison statement ) expression on screen flow logic.we can only write modules i that but in that module u can put the condition to execute that code.
for example
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
MODULE SELECT.
MODULE SELECT OUTPUT.
IF FLAG <> 'Y'.
SELECT AMATNR AEBELN EBELP MENGE LIFNR A~WERKS
FROM EKPO AS A INNER JOIN EKKO AS B
ON AEBELN = BEBELN
INNER JOIN MARC AS C
ON AMATNR = CMATNR
AND AWERKS = CWERKS
INTO TABLE ITAB_TC
WHERE A~EBELN = EKPO-EBELN
AND BSART IN ('ZIMP' , 'ZPO')
AND A~LOEKZ = ' '
AND A~RETPO <> 'X'
AND SERNP = 'Z003'
.
flag = 'Y'.
ENDIF.
ENDLOOP.
Hope it helps.
Regards,
Sonika
‎2007 Apr 14 8:33 AM
Thanks Sonika,
but when i Put If statement in PBO or PAI i am getting error that.
statement IF is not defined.
any clue
‎2007 Apr 14 8:39 AM
Hi,
Have u written the if in statement in the module only or some where else?
i have written that in module and its not giving any error.
pls ckeck ur code or send ur code.
Regards,
Sonika
‎2007 Apr 14 8:43 AM
Please look at the code. i have to call module test1 based on a flag condition.
PROCESS BEFORE OUTPUT.
field TEST_VAR.
module status_modelling.
IF TEST_VAR '0'.
module test1 .
ENDIF.
but i am gettign error for this
‎2007 Apr 14 8:48 AM
Hi,
it will give error like this,
write the if condition in the module.
instead of this
<b>IF TEST_VAR '0'.
module test1 .
ENDIF</b>.
write like this.
<b>module test1 .</b>
IF TEST_VAR '0'.
<b>write ur code here.</b>
ENDIF.
<b>endmodule.</b>
Regards,
Sonika
‎2007 Apr 14 8:59 AM
I want to call Module tes1 only and only when condition is successful..
Not sure if this will help.
cause i can not modify these modules,(part of standard program)
Message was edited by:
Sudhir
‎2007 Apr 14 9:30 AM
To call the module only once you will have to set a Flag inside your module. This cannot be done in the screen flow logic as IF conditions dont work there.
So Basically
<b>MODULE Screen_100 Output.
if flag is initial or if condition is successful.
Write ur code here.
flag = 'X'.
endif.
ENDMODULE.</b>
‎2007 Apr 17 7:34 AM
Thnaks guys.. but infortunately i was trying to use standard SAP modules hence can not copy them. I Copied the modules as Z and then used them..
thanks for your help.
Regards,
Sudhir