Application Development 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: 

how to call three smart forms through one coding

Former Member
0 Kudos

hi all,

I have make three smart forms, which is being called by one coding. Scenario of my coding is that i have restrict these three forms by MOVEMNT TYPE.

for example:

for 1st SMART FORM MOVEMENT TYPE is 101,105 & 321

for 2nd SMART FORM MOVEMENT TYPE is 122 & 124

for 3rd SMART FORM MOVEMENT TYPE is 201 & 261

Problem which i m facing in my coding is that when i want to display 2nd SMART FORM with ELSEIF condition,it will display me but when i want to display 3rd SMART FORM with ELSE codition it give me error: NO OPEN IF STATEMENT.Even though i uses ENDIF key word but still the error exist.Following are the code:

ELSE.

IF int_mseg-bwart = '201' or

int_mseg-bwart = '261'.

endif.

data: ftname(30) type c.

call function 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZCCCL_GOODS_RESERVATION'

IMPORTING

FM_NAME = ftname

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

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 ftname

Exporting

MKPF = int_mkpf

ekko = int_ekko

lfa1 = int_lfa1

makt = int_makt

aufk = int_aufk

RKPF = int_RKPF

RESB = int_RESB

TABLES

MSEG = INT_MSEG

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

ENDIF.

IF SY-SUBRC <> 0.

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

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

ENDIF.

Thanks & Regards,

sappk25

10 REPLIES 10

Former Member
0 Kudos

sorry, but what exactly happened when you tried [to call two smartforms from one coding|] ??

Former Member
0 Kudos

HI ,

use..

IF MOVEMENT TYPE is 101,105 & 321 - > call 1st smartform

ELSEIF MOVEMENT TYPE is 122 & 124 - > call 2nd smartform

ELSEIF MOVEMENT TYPE is 201 & 261 - > call 3rd smartform

ENDIF.

HOPE IT HELPS!

0 Kudos

>

> HI ,

>

> use..

>

> IF MOVEMENT TYPE is 101,105 & 321 - > call 1st smartform

> ELSEIF MOVEMENT TYPE is 122 & 124 - > call 2nd smartform

> ELSEIF MOVEMENT TYPE is 201 & 261 - > call 3rd smartform

> ENDIF.

>

>

> HOPE IT HELPS!

thank you so very much! that's exactly what people like me, who are not developers, would want to avoid at all costs! that's what configuration is for, you know?

0 Kudos

Thanks Varna17 for your replay. Actually MOVEMENT TYPE is field,but in table level it is different so i have define internal table field i-e:

data: int_mseg LIKE STANDARD TABLE OF mseg WITH HEADER LINE.

In this internal table i m using MOVEMENT TYPE filed BWART like this:

  • if int_mseg-bwart = '101' or*

int_mseg-bwart = '105' or

int_mseg-bwart = '321'

So how can i used your solution in this coding.

Thanks & Regards,

sappk25

0 Kudos

configuration also evolve from coding ....

0 Kudos

?

0 Kudos

please help me to resolve my question instead of discussion..

Thanks Varna17 for your replay. Actually MOVEMENT TYPE is field,but in table level it is different so i have define internal table field i-e:

data: int_mseg LIKE STANDARD TABLE OF mseg WITH HEADER LINE.

In this internal table i m using MOVEMENT TYPE field BWART like this:

  • if int_mseg-bwart = '101'*or

int_mseg-bwart = '105' or

int_mseg-bwart = '321'

So how can i used your solution in this coding.

Thanks & Regards,

sappk25

0 Kudos

please anybody give me solution,i have to give this today as my deadline is going to be end, i m waiting for your response.

Thanks & Regards,

sappk25

0 Kudos

Hi,

Problem doesn't seem very difficult but it is hard to say anything without going into debug.

Here are my few suggestion, please check.

(1) Check in debugging that. Is this going into your elseif condition? If yes then what's the problem why it's not generating spool. If problem in form then check the form.

(2) Change the form order, just try to call form (int_mseg-bwart = '201' or int_mseg-bwart = '261'.) in place of first if statement.

(3) Call this form in separate IF .....Endif statement. As you rightly mentioned that the data is coming into your internal table with header line. So there must be only one Movement type and on this condition only one form will trigger.

Thanks.

Anurag

0 Kudos

>

> please anybody give me solution,i have to give this today as my deadline is going to be end, i m waiting for your response.

>

> Thanks & Regards,

> sappk25

That's your problem, not ours. Actually this question and also your recent history of questions seems to be very basic for someone who knows how to work with Smartforms, so please attend some proper training on the matter rather than keeping the forum participants busy on your behalf.

Thread locked.

Thomas