‎2010 Jan 08 9:00 AM
Hi Experts,
I am calling a zreport inside my user exit. This zprogram is wirtten to show a dialog box screen having an ALV.
If I am executing the zprogram seperately thenits working fine, but if I am executing it by subit statemmt form the user exit then at this METHOD it thorws an error somewhere indie:- CALL METHOD ->set_table_for_first_display.
Kindly tell what might be the possible reason. CAlling is like:-
CALL METHOD grid->set_table_for_first_display
EXPORTING
i_save = 'A'
I_STRUCTURE_NAME = 'ZPPM_OPERATION'
is_lAYOUT = GS_LAYOUT
CHANGING
IT_OUTTAB = IT_ZCP_DEMAND_SYS1
IT_FIELDCATALOG = I_FIELDCAT.
‎2010 Jan 08 9:12 AM
<copy&paste_removed_by_moderator>
Edited by: Julius Bussche on Jan 8, 2010 9:43 PM
‎2010 Jan 08 9:16 AM
You should have post [ the link |http://sap.ittoolbox.com/groups/technical-functional/sap-dev/alv-grid-in-background-737708]from where you pasted the answer.
‎2010 Jan 08 9:20 AM
Agreed Amit.....but some times the moderator blocks the reply for pasting a different site's link....
‎2010 Jan 08 9:23 AM
Hi Vin,
As i mentioned the ALV is working fine and so the Zreport if I am executing it directly(not by submit Zreport inside exit). So, Will this be a =n issue?
‎2010 Jan 08 9:24 AM
Udit...check the link which AMIT has given.....it had a similar kind of issue (but in background).....
Try it...
‎2010 Jan 08 10:15 AM
Hi,
I did not get the idea what I need to do, in the link. Please help me understanding the concept.
‎2010 Jan 08 11:05 AM
Do this:
When preparing the field catalog
Give reference table and reference field .
This will surely solve your problem
‎2010 Jan 08 11:31 AM
Hi,
my general solution is:
1) create dictionary structure or at least use only fields with dictionary types with domain.
2) use SALV (CL_SALV_TABLE)
Then all your problems have gone.
Regards,
Clemens
‎2010 Jan 08 12:17 PM
Thanx Abishek,
I implemented ref_fieldname and ref_tablename in fieldcatalog but now i am getting dump CNTL_ERROR.
pls help
‎2010 Jan 08 12:32 PM
Can you tell where are you getting this dump.
And elaborate what message are you getting .
‎2010 Jan 08 3:44 PM
at least create a dictionary structure for the alv display table, pass the name with ...first_display. Also make sure that any special fields i.e. for cell color or style that you reference in the layout structure exist in the table structure.
You will not get a dump if you follow this.
Regards,
Clemens
‎2010 Jan 08 8:46 PM
> Agreed Amit.....but some times the moderator blocks the reply for pasting a different site's link....
ittoolbox is not blocked because they have not spammed us with plagiarised information and link-farms.
Posting a link on it's own is anyway questionable -> the person could have found it themselves if they had used the search.
If you can answer by simply going a search, then rather tell the person to search as well....
Cheers,
Julius
‎2010 Jan 11 5:53 AM
Hi Abhishek,
The new error messgae now I am getting is :-Exception condition "CNTL_ERROR" raised.
The palce is somewhere in standard code:-
check handle
IF ME->H_CONTROL IS INITIAL.
RAISE CNTL_ERROR.
ENDIF.
Kindly tell if something else is required after implementing those two things you told.
‎2010 Jan 11 5:58 AM
i mean are you getting this dump for field catalog itself or something else.
Can you paste the code here or atleast tell for which fields you are
trying to make a field catalog so that we can help.
It may be possibly due to incorrect assignment or same
assignment related statement for the grid.
Edited by: AbhisheksinghTomar on Jan 11, 2010 11:31 AM
‎2010 Jan 11 9:46 AM
Hi Experts,
I am using method set_table_for_first_display, CNTL->ERROR is coming because of passing fieldcatalog to the method,
If i comment fieldcatalog in method grid is displayed but without fieldcatalog.
Pls note: This code(for ALV) is written in a Zreport, and this Zreport is called inside a user-exit.
data: lt_celltab TYPE lvc_t_styl,
l_index TYPE i.
CLEAR :I_FIELDCAT,I_FIELDCAT[],WA_FIELDCAT.
WA_FIELDCAT-col_pos = 1.
WA_FIELDCAT-FIELDNAME = 'ZC_SUPPLIER'.
WA_FIELDCAT-REF_FIELD = 'ZC_SUPPLIER'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-reptext = 'SUPPLIER'.
WA_FIELDCAT-QUANTITY = 'X'.
WA_FIELDCAT-seltext = 'OPERATION'.
WA_FIELDCAT-outputlen = '9'.
WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
WA_FIELDCAT-col_pos = 2.
WA_FIELDCAT-fieldname = 'ZC_CUSTOMER'.
WA_FIELDCAT-REF_FIELD = 'ZC_CUSTOMER'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-reptext = 'CUSTOMER'.
WA_FIELDCAT-seltext = 'OPERATION DESCRIPTION'.
WA_FIELDCAT-LOWERCASE = 'X'.
WA_FIELDCAT-outputlen = '10'.
*
*WA_FIELDCAT-QUANTITY = ` 'X'.
WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
WA_FIELDCAT-col_pos = 3.
WA_FIELDCAT-fieldname = 'ZC_PO'.
WA_FIELDCAT-REF_FIELD = 'ZC_PO'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-QUANTITY = 'X'.
WA_FIELDCAT-reptext = 'PO'.
WA_FIELDCAT-seltext = 'ACTIVITY'.
WA_FIELDCAT-LOWERCASE = 'X'.
WA_FIELDCAT-outputlen = '10'.
WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
WA_FIELDCAT-col_pos = 4.
WA_FIELDCAT-fieldname = 'ZC_PO_TYPE'.
WA_FIELDCAT-REF_FIELD = 'ZC_PO_TYPE'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-QUANTITY = 'X'.
WA_FIELDCAT-reptext = 'PO_TYPE'.
WA_FIELDCAT-seltext = 'ACTIVITY DESCRIPTION'.
WA_FIELDCAT-LOWERCASE = 'X'.
WA_FIELDCAT-outputlen = '10'.
WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
WA_FIELDCAT-col_pos = 5.
WA_FIELDCAT-fieldname = 'ZC_PART'.
WA_FIELDCAT-REF_FIELD = 'ZC_PART'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-QUANTITY = 'X'.
WA_FIELDCAT-reptext = 'PART'.
WA_FIELDCAT-seltext = 'LOCATION'.
WA_FIELDCAT-outputlen = '10'.
WA_FIELDCAT-LOWERCASE = 'X'.
WA_FIELDCAT-F4AVAILABL = 'X'.
**WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
WA_FIELDCAT-col_pos = 6.
WA_FIELDCAT-fieldname = 'ZC_SCH_DATE'.
WA_FIELDCAT-REF_FIELD = 'ZC_SCH_DATE'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-QUANTITY = 'X'.
WA_FIELDCAT-REPtext = 'SCH_DATE'.
WA_FIELDCAT-seltext = 'RESOURCE'.
WA_FIELDCAT-LOWERCASE = 'X'.
WA_FIELDCAT-outputlen = '10'.
WA_FIELDCAT-F4AVAILABL = 'X'.
*WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
WA_FIELDCAT-col_pos = 7.
WA_FIELDCAT-fieldname = 'ZC_QTY_PO'.
WA_FIELDCAT-REF_FIELD = 'ZC_QTY_PO'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-QUANTITY = 'NOS'.
WA_FIELDCAT-REPtext = 'QTY_PO'.
WA_FIELDCAT-seltext = 'BUCKET CONSUMPTION'.
WA_FIELDCAT-outputlen = '7'.
WA_FIELDCAT-DATATYPE = 'X'.
WA_FIELDCAT-F4AVAILABL = ' '.
WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
***********************
WA_FIELDCAT-col_pos = 8.
WA_FIELDCAT-fieldname = 'ZC_QTY_PLN'.
WA_FIELDCAT-REF_FIELD = 'ZC_QTY_PLN'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-QUANTITY = 'NOS'.
WA_FIELDCAT-REPtext = 'QTY_PLN'.
WA_FIELDCAT-seltext = 'BUCKET CONSUMPTION'.
WA_FIELDCAT-outputlen = '7'.
WA_FIELDCAT-DATATYPE = 'X'.
*
WA_FIELDCAT-F4AVAILABL = ' '.
*WA_FIELDCAT-EDIT = 'X'.
APPEND WA_FIELDCAT to I_FIELDCAT.
CALL METHOD grid->set_table_for_first_display
EXPORTING
i_save = 'A'
I_STRUCTURE_NAME = 'ZCP_DEMAND_SYS'
is_lAYOUT = GS_LAYOUT
CHANGING
IT_OUTTAB = IT_ZCP_DEMAND_SYS1
IT_FIELDCATALOG = I_FIELDCAT.
‎2010 Jan 11 9:58 AM
‎2010 Jan 11 10:01 AM
... and if you just do not follow that:
at least create a dictionary structure for the alv display table, pass the name with ...first_display. Also make sure that any special fields i.e. for cell color or style that you reference in the layout structure exist in the table structure.
Your trouble will not end too soon. The solution is ready within 15 minutes.
Regards,
Clemens
‎2010 Jan 11 10:38 AM
Hi Clemens,
Thanx for your response. I am not able to follow what you mean to say, can you please elaborate it with an example, as how I need to implement your suggestion.
Thanks in advance.
‎2010 Jan 11 10:44 AM
Hi Experts, I am using method set_table_for_first_display, CNTL->ERROR is coming because of passing fieldcatalog to the method, If i comment fieldcatalog in method grid is displayed but without fieldcatalog. Pls note: This code(for ALV) is written in a Zreport, and this Zreport is called inside a user-exit. data:
lt_celltab TYPE lvc_t_styl,
l_index TYPE i.
CLEAR :I_FIELDCAT,I_FIELDCAT[],WA_FIELDCAT.
WA_FIELDCAT-col_pos = 1.
WA_FIELDCAT-FIELDNAME = 'ZC_SUPPLIER'.
WA_FIELDCAT-REF_FIELD = 'ZC_SUPPLIER'.
WA_FIELDCAT-REF_TABLE = 'ZCP_DEMAND_SYS'.
WA_FIELDCAT-reptext = 'SUPPLIER'.
WA_FIELDCAT-QUANTITY = 'X'.
WA_FIELDCAT-seltext = 'OPERATION'.
WA_FIELDCAT-outputlen = '9'.
WA_FIELDCAT-EDIT = ' '.
APPEND WA_FIELDCAT to I_FIELDCAT.
CALL METHOD grid->set_table_for_first_display
EXPORTING
i_save = 'A'
I_STRUCTURE_NAME = 'ZCP_DEMAND_SYS'
is_lAYOUT = GS_LAYOUT CHANGING
IT_OUTTAB = IT_ZCP_DEMAND_SYS1
IT_FIELDCATALOG = I_FIELDCAT.
‎2010 Jan 08 9:37 AM
Hi Udit.
Can you use FM "REUSE_ALV_GRID_DISPLAY" instead of class ALV.
I advise to not use SUBMIT command. You can create a FM in SE37 and you can use it in the user-exit.
Regards.
Caner.
‎2010 Jan 18 9:19 AM
Hi,
if you don't know how to create a dictionary structure and how to pass it to the grid and how to read the documentation, I'm very sorry I can't help you.
Regards,
Clemens