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: 

creating 'perform and form'

Former Member
0 Kudos

hi all

following is the coding, but i am getting error while compiling.

PERFORM authority_check tables itab_deblo_final.

FORM authority_check

tables t_rbkp_blocked structure itab_deblo_final.

-


itab_deblo_final and t_rbkp_blocked are decleared globally.

i want to pass records of itab_deblo_final into t_rbkp_blocked, so what will be the coding in 'perform and form'

pl. show coding in perform and form both.

i will be greatful to u if u could help me.

thanx in advance.

24 REPLIES 24

former_member188685
Active Contributor
0 Kudos

Hi Raj Kote

PERFORM authority_check tables itab_deblo_final.

FORM authority_check

tables t_rbkp_blocked structure itab_deblo_final.

endform.

former_member188685
Active Contributor
0 Kudos

Hey man it was pretty fine you can access all fields of

itab_deblo_final

but if you want to do that in form and endform.

you need to use t_rbkp_blocked and access the data.

regards

vijay

former_member181962
Active Contributor
0 Kudos

PERFORM authority_check tables itab_deblo_final.

FORM authority_check

tables t_rbkp_blocked structure itab_deblo_final.

-


t_rbkp_blocked[] = itab_deblo_final[].

ENDFORM.

YOu don't need to declare t_rbkp_blocked globally as you have it as the Formal parameter.

former_member188685
Active Contributor
0 Kudos

why do u need to pass , it will hold all the data what ever itab has..

regards

vijay

former_member188685
Active Contributor
0 Kudos

hi raj,

Yesterday also You Posted the same question, please try to close this thread if your problem solves.

reward points for helpful answers...

regards

vijay.

Former Member
0 Kudos

Hi,

When u write the perform authority_check tables itab_deblo.

declare itab_deblo_final as the same structure like that of t_rbkp_blocked .

data : itab_deblo_final type standard table of t_rbkp_blocked with header line.

When u create this perform it creates a form...endform

form authority_check tables p_t_rbkp_blocked .

itab_deblo_final[] = p_t_rbkp_blocked[].

......

......

endform.

U can use directly p_t_rbkp_blocked for ur addition data modifications or else move data and use the itab_deblo_final for addition data modifications.

if u want only particular data fields to be moved then use

loop at p_t_rbkp_blocked.

itab_deblo_final-<field1> = p_t_rbkp_blocked-<field1>.

itab_deblo_final-<field2> = p_t_rbkp_blocked-<field2>.

itab_deblo_final-<field5> = p_t_rbkp_blocked-<field5>.

......

......

append itab_deblo_final.

clear : itab_deblo_final, p_t_rbkp_blocked.

endloop.

PL. AWARD APPROPRIATE POINTS

0 Kudos

hi

pl try to understand that itab_deblo has a z_table structure. now i want to give itab_deblo structure to t_rbkp_blocked internal table.

following is a wrong decleration.

data : itab_deblo_final type standard table of t_rbkp_blocked with header

since itab_deblo is already defined.

0 Kudos

so what is your Problem, and

can you paste the code what you are doing...

0 Kudos

Can you paste the relevant code which you are writing..

in side form and endform.

0 Kudos

Hi Raj,

Why do you want to declare a structure for itab_deblo again?

when you pass table as a parameter to a a FORm, then the form receives the same table with the name t_rbkp_blocked in the form.

<b>PERFORM authority_check tables itab_deblo_final.

form authority_check tables t_rbkp_blocked structure itab_deblo_FINAL.

endform. " authority_check</b>

Can you be a bit more clear in your requirement?

If the two internal tables have different structures,

and if your aim is to transfer data from one itab to another, then

you can use

loop at itab1.

move-corresponding itab1 to itab2.

append itab2.

clear itab2.

endloop.

Regards,

Ravi

0 Kudos

hi all again,

pl try to understand that i am getting mismatch error while complining in the following coding.

following are the changes i am doing in original prog.

orignal prog is shown at the bottom.

changes====

PERFORM authority_check tables itab_deblo_final.

form authority_check tables t_rbkp_blocked structure itab_deblo_FINAL.

both have globally decleared structure. itab_deblo_final has a structure of z_table and

t_rbkp_blocked is decleared as follows.

data: begin of t_rbkp_blocked occurs 0.

include structure itab_deblo_final .

data: end of t_rbkp_blocked.

now i want diff coding so that mismatch prob should solve.

-

-


following is the original coding ====

***INCLUDE Z06_FIL120_F0C .

*----


*

  • Form AUTHORITY_CHECK

*----


*

  • Berechtigung prüfen

*

*----


*

  • FORM authority_check

  • TABLES t_rbkp_blocked TYPE *mrm_tab_rbkp_blocked.

*(mrm_tab_rbkp_blocked needs to *be replaced with itab_deblo_final)

so i am doing following changes, but that is giving error

FORM authority_check

tables t_rbkp_blocked structure itab_deblo_final.

DATA: f_list_incomplete. " flag: list incomplete

DATA: f_auth TYPE activ_auth.

LOOP AT t_rbkp_blocked.

IF NOT t_rbkp_blocked-ekgrp IS INITIAL.

PERFORM ekgrp_authority_check USING t_rbkp_blocked-ekgrp

CHANGING f_auth.

IF f_auth IS INITIAL.

DELETE t_rbkp_blocked.

f_list_incomplete = 'X'.

ENDIF.

ENDIF.

ENDLOOP.

CLEAR : w_cle_objet.

READ TABLE t_rbkp_blocked INDEX 1.

IF sy-subrc <> 0.

w_cle_objet = 'Enumération des factures bloquées'.

PERFORM f900_erreur

USING sy-cprog 'Fichier' w_cle_objet sy-datum sy-uzeit

'E' '653' 'M8' '' '' '' ''.

ELSEIF NOT f_list_incomplete IS INITIAL.

w_cle_objet = 'Liste'.

PERFORM f900_erreur

USING sy-cprog 'Fichier' w_cle_objet sy-datum sy-uzeit

'E' '657' 'M8' '' '' '' ''.

ENDIF.

ENDFORM.

0 Kudos

<b>data: begin of t_rbkp_blocked occurs 0.

include structure itab_deblo_final .

data: end of t_rbkp_blocked.</b>

this is not required...

0 Kudos

you need to declare only itab_deblo_final .

no need of this declaration

remove the global declaration

<b>data: begin of t_rbkp_blocked occurs 0.

include structure itab_deblo_final .

data: end of t_rbkp_blocked.</b>

regards

vijay

0 Kudos

hi

even after removing global decleration i am getting incompatible error.

error: stru of itab_deblo and t_blocked are incompatible.

0 Kudos

Do one thing first write this

PERFORM authority_check tables itab_deblo_final.

then click on this ...

it will ask you to create then just specify the program and enter

then it will give the code.

*&---------------------------------------------------------------------*
*&      Form  authority_check
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_IT_deblo  text
*----------------------------------------------------------------------*
FORM authority_check  TABLES   P_ITab_deblo_final STRUCTURE z_table.
                                 "Insert correct name 

ENDFORM.                    " authority_check

0 Kudos

what ever the code it gives try to modify to the below.

FORM authority_check  TABLES   P_ITab_deblo_final STRUCTURE z_table.
                                 "Insert correct name 
 
ENDFORM.                    " authority_check

and check ...

regards

vijay

0 Kudos

hi all

here is my itab_deblo_final table structure

data: begin of itab_deblo_final occurs 0,

belnr like z06_fct_mm_deblo-belnr,

budat like z06_fct_mm_deblo-budat,

gjahr like z06_fct_mm_deblo-gjahr,

buzei like z06_fct_mm_deblo-buzei,

aedat_spgrp like z06_fct_mm_deblo-aedat_spgrp,

zuonr like z06_fct_mm_deblo-zuonr,

erfnam like z06_fct_mm_deblo-erfnam,

lifnr like z06_fct_mm_deblo-lifnr,

name1 like z06_fct_mm_deblo-name1,

ktokk like z06_fct_mm_deblo-ktokk,

wrbtr like z06_fct_mm_deblo-wrbtr,

waers like z06_fct_mm_deblo-waers,

ebeln like z06_fct_mm_deblo-ebeln,

ebelp like z06_fct_mm_deblo-ebelp,

matnr like z06_fct_mm_deblo-matnr,

werks like z06_fct_mm_deblo-werks,

spgrm like z06_fct_mm_deblo-spgrm,

spgrp like z06_fct_mm_deblo-spgrp,

dwert like z06_fct_mm_deblo-dwert,

kursf like z06_fct_mm_deblo-kursf,

ekgrp like z06_fct_mm_deblo-ekgrp,

usnam like z06_fct_mm_deblo-usnam.

data: end of itab_deblo_final.

0 Kudos

Hi as they said you created them globally no need to use tables parameter, or try to use as i mentioned as above.

regards

vijay

0 Kudos

hi all

my prob is not yet solved. i am getting error while compiling when i use table and structure in form.

is there any other way to solve this

Former Member
0 Kudos

Hello Raj,

Could you give us the coding of the declaration of itab_deblo_final?

Thanks

Frédéric

Former Member
0 Kudos

Hi,

Anyway u have declared the Tables Globally.So no need to pass it thru Fnction

jus give Perform Fun_Name.

Form Fun_Name.

With in this u can use the tables and structure as they have been declared Globally

endform.

Former Member
0 Kudos

Hi raj,

1. can u give the full code :

all the program names and the respective codes.

the whole narrations are getting more confused

without much clarity.

regards,

amit m.

Former Member
0 Kudos

Hello Raj,

small program to make a test :

-

-


REPORT ZTEST.

data:

begin of itab_deblo_final occurs 0,

matnr like mara-matnr,

end of itab_deblo_final.

PERFORM authority_check tables itab_deblo_final.

form authority_check tables t_rbkp_blocked structure

itab_deblo_FINAL .

endform. " authority_check

-

-


This is compiling without any problem in ECC5.0

You do not need to declare t_rbkp_blocked as global variable.

Regards,

Frédéric

Former Member
0 Kudos

hi,

you need give endform at the end and it is necessry that u should not write any statements or declare any variable after endform.

regards

Arun