Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Conditional Logic in Program Lines of Smartform

Hey,

Can i add logic in Program Lines that if it is satisfying a condition it will call to ADDRESS window otherwise it will call to TEXT WINDOW ?

Problem am facing : (window PARTY ADDRESS)

select single * from kna1 into l_kna1 where kunnr = it_header-kunnr.

if the above statement is true then It will call to ADDRESS NODE otherwise it will call to some Text nodes (&g_name1& , &g_name2&)..

Thanks in Advance

SATYA

Edited by: Satyabrata sahoo on Sep 8, 2008 12:26 PM

replied

Hi,

Write the logic in INITIALIZATION and set a flag... Based on the value of the flag set the CONDITION in the

Condition TAB of the window.

Write code in INITIALIZATION TAB of GLOBAL DECLARATION AS BELOW.

Clear flag.  " Declare the flag variable in Global declarations...
select single * from kna1 into l_kna1 where kunnr = it_header-kunnr.
IF sy-subrc eq 0.
   flag = 'X'.
ELSE.
  Flag = ' '.
ENDIF.

That would solve your issue.

Good luck

Narin

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question