cancel
Showing results for 
Search instead for 
Did you mean: 

printing the internal table contents to smart form ?

Former Member
0 Kudos

hi folks ,

I need a help .

below is my code :

REPORT ZAJAY .

tables: vbap,vbak.

data flag(1).

data: form_name type tdsfname value 'ZAJAY'.

DATA : FM_NAME TYPE RS38L_FNAM.

PARAMETERS : VBELN LIKE VBAK-VBELN OBLIGATORY,

KUNNR like VBAK-KUNNR OBLIGATORY.

DATA : BEGIN OF ITAB OCCURS 0 .

INCLUDE STRUCTURE VBAP.

DATA : END OF ITAB .

data t_itab like itab occurs 0 with header line .

start-of-selection .

select single * from vbak where vbeln = vbeln and kunnr = kunnr .

select * from vbap into corresponding fields of table t_itab where

vbeln

= vbak-vbeln .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = form_name

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = 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.

CALL FUNCTION '/1BCDWB/SF00000016'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

VBELN = VBELN

KUNNR = KUNNR

FLAG = flag

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

ITAB = t_itab.

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

my problem is that the value of table t_itab is not being moved to itab .

now below is my declaration in the smartform for loop .

i created one loop .

looping from itab to w_itab .

itab is the interface parameters and w_itab is the gobal declaration .

i am printing values like as it appears on form :

-


item description material no. quantity net value

-


000 000 00 00

how to extract the values ?

plz provide your valuable inputs .

Thanks ,

Abhishek

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Abi,

You have to defined a IT table (same structure like t_itab in your print program ) in the table tab of the smartforms.

Activate the form and then call the FM once again and then see are you able to see the IT defined in smartforma as a table parameter.

<b>

Please remember</b> if there is a difference in the internal table defined in the Print program and the Sartor, you are not able to print the correct data.

Regards

Vikas

abhishek_gupta2
Participant
0 Kudos

folks ,

i have done as suggested by you , but its not working .

thanks ,

Abhishek .

Former Member
0 Kudos

HI,

Change this line:

CALL FUNCTION '/1BCDWB/SF00000016'

to CALL FUNCTION fm_name ......

In the Form Interface node of the smartform, go to tables parameter, and enter ITAB LIKE VBAP.

Regards

Subramanian

Former Member
0 Kudos

Hi,

In the smartform itab should be declared as internal table in tables tab which should be of type vbap.

Check how did you declare itab in the smartform.

Br,

Laxmi.