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: 

FORM parameters type of table

Former Member
0 Kudos

Hi,

in my program i need to pass a parameter to my form ; this parameter is a type of table. In my form when i want to access to an attribut, SAP tell me that the parameter data object 'P1001A' has no structure and therefore no component called BUKRS.

REPORT  z_erca_test.

DATA l_1001a TYPE T001A_T.

PERFORM cal_manager USING l_1001a.

FORM cal_manager using p1001a.

  write p1001a-BUKRS.

ENDFORM.

So i tried to pass 'TYPE T001A' to the parameter, but i still have an error.

Thanks for help

Cheers

1 ACCEPTED SOLUTION

Former Member
0 Kudos

The perform doesn't know what you passed to him therefor tell him what type it is.

Afterwards you want to show a field from a table but doesn't tell the program what line you want to display it from.

Give a workarea to the perform or create a workarea in the perform and read the line you want to show the field from.

Example:

REPORT  z_erca_test.

DATA l_1001a TYPE T001A_T.

PERFORM cal_manager USING l_1001a.

FORM cal_manager using p1001a TYPE T001A_T.
  
  data: lwa like LINE OF p1001a.
  
  read table p1001a into lwa index 1.
  
  write lwa-BUKRS.

ENDFORM.

Edited by: Christophe Gillijns on May 26, 2010 2:57 PM

6 REPLIES 6

Former Member
0 Kudos

hi,

Use tables statement in your perform.

eg.

data: t_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,

wa_fieldcat TYPE slis_fieldcat_alv.

PERFORM f_populate_fieldcatalog TABLES t_fieldcat.

FORM f_populate_fieldcatalog TABLES p_t_fieldcat STRUCTURE wa_fieldcat.

CODE...

ENDFORM

matt
Active Contributor
0 Kudos

DATA l_1001a TYPE T001A_T.

...

FORM cal_manager using p1001a TYPE T001A_T.

Should work. I suggest you buy a book on ABAP programming and how types work. This forum is not to be used as a free training course.

former_member214857
Contributor
0 Kudos

Hi

You can write a report like sample below:

REPORT  z_erca_test.
 
DATA l_1001a TYPE T001A_T.
 
PERFORM cal_manager USING l_1001a.
 
FORM cal_manager using p1001a TYPE t001a.
 
  write p1001a-BUKRS.
 
ENDFORM.

Instead of use table type you can use directly table structucre in form parameter

Kind regards

Carlos Machado

Former Member
0 Kudos

The perform doesn't know what you passed to him therefor tell him what type it is.

Afterwards you want to show a field from a table but doesn't tell the program what line you want to display it from.

Give a workarea to the perform or create a workarea in the perform and read the line you want to show the field from.

Example:

REPORT  z_erca_test.

DATA l_1001a TYPE T001A_T.

PERFORM cal_manager USING l_1001a.

FORM cal_manager using p1001a TYPE T001A_T.
  
  data: lwa like LINE OF p1001a.
  
  read table p1001a into lwa index 1.
  
  write lwa-BUKRS.

ENDFORM.

Edited by: Christophe Gillijns on May 26, 2010 2:57 PM

matt
Active Contributor
0 Kudos

Good point Christopher - the original poster is not only using the wrong type, he's confusing tables and workareas. Hence my comment about training...

0 Kudos

Thanks a lot Christophe, i was confused But it's so logical.

Cheers

ps: Matt thank you for your support...