Application Development and Automation 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: 
Read only

Smartform, + dynamic call depending upon company-code

Former Member
0 Likes
530

Hello friends,

I have a req, at this time in the program a particular smartform is being called. I have to make the code likewise that depending upon the company-code another smartform should be called ?

Someone gave me hint, it could be done dynamically.....

Can any one, pls give me hint, or docu...

Regards,

4 REPLIES 4
Read only

Former Member
0 Likes
487

Hi Shah,

Refer this code.

loop at itab.

if itab-bukrs = '0001'.

P_form = write heresmart form name

elseif itab-bukrs = '0002'.

p_form= ................

endif.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = P_FORM

IMPORTING

FM_NAME = P_FUNCTION

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION P_FUNCTION

TABLES

D_VBRK = IT_VBRK

D_VBRP = IT_VBRP

D_LIKP = IT_LIKP

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

reward points if helpful.

Regards,

Hemant

Read only

0 Likes
487

Hi Hemant,

Thanks for your help,

I am just woundring, ( as I have never worked with smartform before) how to fill the two forms ( as one form is already fillied , and depending upon I have to fill the other table )....

Regards,

Read only

0 Likes
487

Shah,

So you have opened a new thread.Fine,for ex if the sales org 200 in UK is having a window for tax and sales organisation 201 in US is not having any tax then you have to make this tax window invisible when executing the smartform for the sales org 201.

This thing you can validate using the field land1 in the table t005.

K.Kiran.

Read only

former_member377111
Participant
0 Likes
487

shah,

In your driver programe write the code in such a way that

if Bukrs = ' 001 '.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'(here u can specify ur form required for this company code.)

else..............

endif.

Hope this will help you