‎2010 Mar 08 4:13 AM
Dear forumers,
When the following code is executed:-
perform clear_component_value using c_ryyrkeg_wwsub
<ls_movement>
changing <lv_ryyrkeg_wwsub>.I have the following syntax error:-
In PERFORM or CALL FUNCTION "CLEAR_COMPONENT_VALUE", the actual parameter "C_RYYRKEG_WWSUB" is incompatible with the formal parameter "PV_COMP_NAME".
Further codes:-
form CLEAR_COMPONENT_VALUE using pv_comp_name type char255 " How can I type this parameter properly? - tried type STRING too
pv_fs_struct type any
changing pv_fs_var type any.
ASSIGN COMPONENT pv_comp_name OF STRUCTURE pv_fs_struct TO pv_fs_var.
IF sy-subrc = 0.
CLEAR pv_fs_var.
ENDIF.
UNASSIGN pv_fs_var.
endform. " CLEAR_COMPONENT_VALUECONSTANTS:
c_ryyrkeg_wwsub(13) TYPE c VALUE 'RYYRKEG_WWSUB',
c_racct(5) TYPE c VALUE 'RACCT',
c_ryymac(6) TYPE c VALUE 'RYYMAC',
c_rzzvbund(8) TYPE c VALUE 'RZZVBUND',
c_ryypma(6) TYPE c VALUE 'RYYPMA',
c_ryyrkeg_wwato(13) TYPE c VALUE 'RYYRKEG_WWATO',
c_rbukrs(6) TYPE c VALUE 'RBUKRS',
c_rtcur(5) TYPE c VALUE 'RTCUR',
c_tsl(3) TYPE c VALUE 'TSL',
c_hsl(3) TYPE c VALUE 'HSL',
c_ryear(5) TYPE c VALUE 'RYEAR',
c_tslvt(5) TYPE c VALUE 'TSLVT',
c_hslvt(5) TYPE c VALUE 'HSLVT',
c_rldnr(5) TYPE c VALUE 'RLDNR'.How may I resolve this error, seeing that the PV_COMP_NAME should actually be constant variables of type c? Please help me out here. Appreciate any inputs at all. Thanks.
‎2010 Mar 08 4:25 AM
Hello,
This is because the lenght of the actual & the formal parameters are different.
I understand from your code that you are trying to assign the field of the dynamic structure to some field-symbol & the constants declared are nothing but the fields of the structure try defining all of them as TYPE FIELDNAME & use the same in your FORM declaration as well.
form CLEAR_COMPONENT_VALUE using pv_comp_name type fieldname
pv_fs_struct type any
changing pv_fs_var type anyHope this helps.
BR,
Suhas
‎2010 Mar 08 4:25 AM
Hello,
This is because the lenght of the actual & the formal parameters are different.
I understand from your code that you are trying to assign the field of the dynamic structure to some field-symbol & the constants declared are nothing but the fields of the structure try defining all of them as TYPE FIELDNAME & use the same in your FORM declaration as well.
form CLEAR_COMPONENT_VALUE using pv_comp_name type fieldname
pv_fs_struct type any
changing pv_fs_var type anyHope this helps.
BR,
Suhas
‎2010 Mar 10 5:46 AM
Hi Suhas,
Type FIELDNAME resolved the issue.
Thanks to everyone for the inputs as well.
‎2010 Mar 08 4:31 AM
Hi,
1.form CLEAR_COMPONENT_VALUE using pv_comp_name like c_ryyrkeg_wwsub
pv_fs_struct type any
changing pv_fs_var type any.
But the value can't be chnaged inside the subroutine.
2.Decalre wvl_temp as c_ryyrkeg_wwsub and use that in form
form CLEAR_COMPONENT_VALUE using pv_comp_name like wvl_temp
pv_fs_struct type any
changing pv_fs_var type any.
You can very well modify the values.
Thanks & Regards,
Vamsi.
‎2010 Mar 08 4:39 AM
Hello Vamshi,
So you mean you cannot change the values of the formal params which are PASSED BY REFERENCE ? Please enlighten me.
Anyways i donot see where the value of the param pv_comp_name is changed in the sub-routine?
BR,
Suhas
‎2010 Mar 08 4:45 AM
Hi Suhas,
If you see my code block.
It will behave in the manner which i have told.
And i mean by "You cannot change the value is an information as it is disadvantage " for my code block.
And your reply resolves, since the variable is not modified inside subroutine.
Thanks & Regards,
Vamsi.
Edited by: Vamsi Krishna on Mar 8, 2010 5:45 AM
‎2010 Mar 08 4:55 AM
Then you should rephrase your statement as : "You should not change the values of a USING param".
FYI , even if you do so in Extended Syntax Check you will get a warning message for this.
Suhas
‎2010 Mar 08 4:59 AM
Hi,
Sorry for that.
And you are right.
Thanks & Regards,
Vamsi.
‎2010 Mar 08 6:12 AM
hi deborah ,
i think make it char13 as it is defined as 13 char long
form CLEAR_COMPONENT_VALUE using pv_comp_name type char13
hope this will help you
thanks
tanmaya