2009 Jun 19 7:33 AM
Hi Experts,
1.What is the Difference between sy-repid and sy-cprog?
2.I have used "Reuse_alv_fieldcatalog_merge'.In that program i passed
types : begin of ty_ekpo,
ebeln type ekpo-ebeln,
ebelp type ekpo-ebelp,
menge type ekpo-menge,
meins type ekpo-meins,
netpr type ekpo-netpr,
end of ty_ekpo.
data : it_ekpo type table of ty_ekpo,
wa_ekpo type ty_ekpo,
it_fcat type slis_t_fcat_alv,
wa_fcat like line of it_fcat.
call function 'reuse_alv_fieldcatalog_merge'
exporting
i_callback_program = sy-repid
i_internaltable_name = 'internal table name'
i_incl name = sy-repid
changing
ct_fcat = it+fcat.
---> first i executed this program it is not given the fieldcatalog.The it_fcat is initial.
---> I have changed the structure ty_ekpo declaration as follows ,
types : begin of ty_ekpo,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
menge like ekpo-menge,
meins like ekpo-meins,
netpr like ekpo-netpr,
end of ty_ekpo.
i used LIKE instead of TYPE (((( eg,, ebeln LIKE ekpo-ebeln instead of TYPE ekpo-ebeln)))
Then it worked fine
_________
And after that i removed again LIKE and place TYPE ,Now it is working fine wth TYPE .
I did not understand why it is happened like that,
please explain me.
2009 Jun 19 7:36 AM
Hi,
sy-repid-------Name of the current ABAP program.
sy-cprog------the name of the calling program.
Regards,
jaya
2009 Jun 19 7:42 AM
Hi Jaya ,
Thanks For ur answer.
I had also written some code there regarding ALV_fieldacat_merge?Can u go through it and clear my doubt
And also do u have any example explaining sy-repid and sy-cprog
2009 Jun 19 7:45 AM
>
> And also do u have any example explaining sy-repid and sy-cprog
Create one mail program and define perform routine in that. Also, use some includes programs and form definition in these includes. Than debug your program, while your control reaches in form routine than see the values of sy-repid and sy-cprog.
2009 Jun 19 7:39 AM
Hi,
Sy-repid --- It contains the name of current program.
Sy-cprog---Contains the name of calling program.
Like is gnerally used if ur referring Data Objects(Like fields in adata base table)
Type is for Data Element.In Table EKPO the name of the field and Name of Data Element Is the same i.e EBELN for Both .Hence No issue.
Regards,
Lakshman.
2009 Jun 19 7:44 AM
When we are working with Field catlogue merge,you have to use LIKE only.
For your case ,if you run your program after some time with TYPE it does not give any fileld catalogue.
sy-repid - It gives current ABAP program name.
sy-cprog - ABAP program, caller in external procedures.