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 printing

former_member203806
Participant
0 Likes
3,742

Hi All

I have internal table with two fields

vbeln

fkdat

i have pass that internal table to smartform.

and loop in the table, it is printing all the invoices in one page.......

in smartform i need to print single vbeln and single fkdat per page.

how can i do it ?

********************

Page1

********************

vbeln1

kadat1

*******************

page2

******************

vbeln 2

fkdat 2

.......

rgds

pramod

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,701

inside loop add command(inside end of loop) node and in general attribute select go to new page.

19 REPLIES 19
Read only

Former Member
0 Likes
3,701

Hi,

Please try your vbeln specific internal table in your driver program.

use your Smartform FM in inside internal table  then this will be printing one by one  based on VBELN.

try your driver code like below

'SSF_FUNCTION_MODULE_NAME'

   
EXPORTING

      formname          
= w_form

   
IMPORTING

      fm_name           
= w_fm_name

   
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.

  l_output_options
-tddest = itcpo-tddest.

 
if itcpo-tdcopies gt 0.

    l_output_options
-tdcopies = itcpo-tdcopies.

 
else.

    l_output_options
-tdcopies = 1.

 
endif.

  l_output_options
-tdimmed = 'X'.

  l_control_parameters
-langu = nast-spras.

clear: lwa_kunnr.

loop at ltb_kunnr into lwa_kunnr.

 
call function w_fm_name

   
exporting

      CONTROL_PARAMETERS        
= l_control_parameters

      OUTPUT_OPTIONS            
= l_output_options

      USER_SETTINGS             
= ' '

      wa_kunnr                 
= lwa_kunnr-kunnr

      vttkvb                    
= vttkvb

   
EXCEPTIONS

      FORMATTING_ERROR          
= 1

      INTERNAL_ERROR            
= 2

      SEND_ERROR                
= 3

      USER_CANCELED             
= 4

     
OTHERS                     = 5.

 
if sy-subrc <> 0.

    l_subrc
= sy-subrc.

   
MESSAGE e000(pais) with 'SmartForm failed; RC='  l_subrc.

 
endif.

endloop.

Regards,

Prasenjit

Read only

0 Likes
3,701

Hi Prasanjith

in my internal table also vbeln specified. what are the conditions i have to put in smartforms.

rgds

pramod

Read only

0 Likes
3,701

Hi ,

just pass only one vbeln in inside your smartform then it will be printing like that,

I was one Kunnr at a time in my driver program that time I can print more than one kunnr in seprate page.

you can try to same  logic.

Regards,

Prasenjit

Read only

0 Likes
3,701

thats true. but i need to pass all the other data to smartform at one time.

but i need to print base by VBELN....

Read only

0 Likes
3,701

Hi Pramod,

In driver program you can add VBELN value also and that VBELN value  you can validate  in inside smartform for all data.

like if you need to print VBELN related value then you can pick  only for that VBELN related value in your driver program or  in inside  your smart form.

Regards,

Prasenjit 

Read only

0 Likes
3,701

Hi Parsanjith

im new for ABAP, Can u tell me hw can i validate it.

pramod

Read only

0 Likes
3,701

Hi ,

In inside layout  if you use table then please add where condition otherwise you can filter all VBELN respective data in Gloabl definiton  (Initialization) area and add your code in inside initialization.

or

you can pass all filter  data from your driver program based on your VBELN field.

Regards,

Prasenjit

Read only

Former Member
0 Likes
3,702

inside loop add command(inside end of loop) node and in general attribute select go to new page.

Read only

0 Likes
3,701

can u pls explain it...

Read only

0 Likes
3,701

USE NEW_PAGE using "Command" in your LOOP

Regards,

Ritesh

Read only

0 Likes
3,701

hi

which condition i have to check...

pramod

Read only

0 Likes
3,701

use Table Line or Loop in your smartform, after printing values of vbeln/fkdat in your form using TEXT_CONTROL insert NEW_PAGE command.

Thanks,

Ritesh

Read only

0 Likes
3,701

hi

new print 11 pages, only header .

not printing the values in main

Read only

0 Likes
3,701

hi

thank you very much.

i have done it. but problem is i have 10 order number, it it printing 11 pages.

last page print only header. hw can i fix it...

Read only

0 Likes
3,701

Hi,

It means your ITAB is not transferring values to your WORKAREA.

Might be you are not printing data using WORKAREA.

Try to use ITAB loop INTO WA and print values using WORKAREA

Regards,

Ritesh

Read only

0 Likes
3,701

Okay..!

Assign total no of records to a global variable using DESCRIBE TABLE and simultaneously count records in loop.

After that check condition in NEW_PAGE

globalvariable NE reccount.

-- Ritesh

Read only

0 Likes
3,701

This message was moderated.

Read only

0 Likes
3,701

Hi

Thank u very much.. i have done it,

i marked as correct answer....

rgds

pramod

Read only

gaurab_banerji
Active Participant
0 Likes
3,701

This message was moderated.