Skip to Content
0
Former Member
Aug 03, 2005 at 10:58 AM

Calling a Form from a function

78 Views

Hi,

I'm trying to modularise my code. I have a function which call some forms. But when I try and compile it, I keep getting Syntax errors, and I'm not sure how to get round them. The code is shown below.

FUNCTION z_fs_allocated_payment_clear.

DATA BEGIN OF bdcdtab OCCURS 1.

INCLUDE STRUCTURE bdcdata.

DATA END OF bdcdtab.

DATA BEGIN OF messtab OCCURS 10.

INCLUDE STRUCTURE bdcmsgcoll.

DATA END OF messtab.

DATA BEGIN OF ybsid OCCURS 1.

INCLUDE STRUCTURE bsid.

DATA END OF ybsid.

PERFORM ybsid_fill ybsid.

PERFORM bdcdtab_fill bdcdtab.

PERFORM call_transaction.

endfunction.

FORM bdcdtab_fill using bdcdtab.

CLEAR bdcdtab.

REFRESH bdcdtab.

*-- Felder des Startdynpros der Ausgleichstransaktion füllen------

bdcdtab-program = 'SAPMF05A'.

bdcdtab-dynpro = '0131'.

bdcdtab-dynbegin = 'X'.

bdcdtab-fnam = ' '.

bdcdtab-fval = ' '.

APPEND bdcdtab.

.

.

.

Endform.

FORM ybsid_fill changing ybsid.

ybsid-mandt = '800'.

ybsid-bukrs = '2000'.

ybsid-kunnr = '0000300730'.

  • ybsid-umsks =

  • ybsid-umskz =

  • ybsid-augdt =

  • ybsid-augbl =

ybsid-zuonr = 'V31'.

ybsid-gjahr = '2005'.

.

.

.

endform.

I've tried using "changing, using , tables" to no avail.

Thanks