cancel
Showing results for 
Search instead for 
Did you mean: 

function module output in smart form

Former Member
0 Kudos

Hellow experts,

Here i have one Function Module like ZSAMPLE1.

I want to display its output in SmartForm.

What should I do for this. Pls help me.

with regards

babu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi this is a simple report to display the data from sd...

create variables in import im the global definitions or declare tabels for this ....

REPORT zpr_17

NO STANDARD PAGE HEADING LINE-SIZE 255.

TABLES: vbak.

DATA: BEGIN OF it_vbak OCCURS 0,

vbeln LIKE vbak-vbeln,

vkorg LIKE vbak-vkorg,

spart LIKE vbak-spart,

END OF it_vbak,

BEGIN OF it_vbap OCCURS 0,

vbeln LIKE vbap-vbeln,

posnr LIKE vbap-posnr,

matnr LIKE vbap-matnr,

END OF it_vbap,

BEGIN OF it_final OCCURS 0,

vbeln LIKE vbap-vbeln,

vkorg LIKE vbak-vkorg,

spart LIKE vbak-spart,

posnr LIKE vbap-posnr,

matnr LIKE vbap-matnr,

END OF it_final.

SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.

START-OF-SELECTION.

PERFORM get_data.

PERFORM print_data.

&----


*& Form get_data

&----


  • text

----


FORM get_data .

SELECT vbeln vkorg spart INTO TABLE it_vbak

FROM vbak WHERE vbeln IN s_vbeln.

IF NOT it_vbak[] IS INITIAL.

SELECT vbeln posnr matnr INTO TABLE it_vbap

FROM vbap

FOR ALL ENTRIES IN it_vbak

WHERE vbeln = it_vbak-vbeln.

ENDIF.

LOOP AT it_vbap.

READ TABLE it_vbak WITH KEY vbeln = it_vbap-vbeln.

IF sy-subrc = 0.

it_final-vbeln = it_vbak-vbeln.

it_final-vkorg = it_vbak-vkorg.

it_final-spart = it_vbak-spart.

ENDIF.

it_final-posnr = it_vbap-posnr.

it_final-matnr = it_vbap-matnr.

APPEND it_final.

CLEAR: it_final,

it_vbak,

it_vbap.

ENDLOOP.

ENDFORM. " get_data

&----


*& Form print_data

&----


  • text

----


FORM print_data .

CALL FUNCTION '/1BCDWB/SF00000858'

TABLES

it_final = it_final .

ENDFORM. " print_data

regards,

venkat.

Former Member
0 Kudos
Former Member
0 Kudos

hai venkat,

than q for ur reply,

here my requirement is in my function module i am displaying the payslip . by using this fm i want to display that payslip in smart form.

is it possible? how?

any idea.

with regards

babu