Skip to Content

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 08, 2008 at 07:04 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 08, 2008 at 06:59 AM

    Use condition from condition tab in ADDRESS NODE and Text nodes rather than in program lines.

    Edited by: Amit Gujargoud on Sep 8, 2008 8:59 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2008 at 07:33 AM

    Create Alternative node

    It is basically works on condition (like if endif)

    try this

    Add comment
    10|10000 characters needed characters exceeded