ALV output is not Coming
Hi Friend ,
I ve a problem with the ALV output. Actually i am getting all the value in the internal table and then i am binding the table with the node . But i wonder why the output is not coming in the ALV table only the blank table is coming .
Regards,
Satya
Hi
first u instantiate the alv component with the use of wizard.
then u call the method "GET_MODEL".
Then u call the method "SET_DATA" and set the alv table with the node in which u have ur data.
check this code.....
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
*declaration of alv usage
*declare config model
DATA lo_config_model_value TYPE REF TO cl_salv_wd_config_table.
lo_cmp_usage = wd_this->wd_cpuse_alv_requi_list( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
lo_interfacecontroller = wd_this->wd_cpifc_alv_requi_list( ).
lo_config_model_value = lo_interfacecontroller->get_model( ).
lo_interfacecontroller->set_data(
r_node_data = lo_nd_req_list
here lo_nd_req_list is the name of my node.
Regards
chythanya
Similar Messages
-
Page-break in alv background job for alv output variant not coming correctl
Hi,
I have created an ALV grid report. When i run the report in background i get the output with correct page-break on FIELD1. Now when i run the report in background with an "ALV output variant" (its the ALV variant that controls the fields display in the output; this is not the program variant), i do not get the page-break on FIELD1. I have already build the sort criteria and using:
gs_sort-group = '* '. "New-Page
Please let me know what could be reason for not getting the page-break in background when i am using the alv output variant and how do i correct this problem.
Regards,
RakeshHello Everyone,
I have solved the problem. While running the program in background, we get the page-breaks when we use the below part of code in the sort catalogue with the condition that the program variant should not use any ALV layout variant.
gs_sort-group = '* '. "New-Page
If you are using the ALV layout variant in the program variant then we can check the ROWPOS, COLPOS, and NO_OUT for that ALV layout variant and pass them along in the fieldcatalog table. You should be careful with not to pass the layout variant in the DISVARIANT. You can notice that i have cleared it and simply passing the program name into that.
*C-- Process separately for jobs running in Background. Actually
*C-- sortcat-group solves the problem only in Foreground. In background
*C-- when ALV layout variant is not selected then it works otherwise it
*C-- fails. So for background jobs we are reading the fieldcat and then
*C-- passing the same in the display FM.
IF sy-batch = 'X'.
CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
EXPORTING
i_dialog = ' '
i_user_specific = ' '
i_default = ' '
* I_TABNAME_HEADER =
* I_TABNAME_ITEM =
it_default_fieldcat = gt_fieldcat
i_layout = gs_layout
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
IMPORTING
* E_EXIT =
et_fieldcat = lt_fieldcat
* et_sort = gt_sort[]
* ET_FILTER =
* es_layout = gs_layout
CHANGING
cs_variant = gs_disvariant
EXCEPTIONS
wrong_input = 1
fc_not_complete = 2
not_found = 3
program_error = 4
OTHERS = 5
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR gs_fieldcat.
LOOP AT gt_fieldcat INTO gs_fieldcat.
*C-- Transfer all position changes to gt_fieldcat from lt_fieldcat
CLEAR ls_fieldcat.
READ TABLE lt_fieldcat
INTO ls_fieldcat
WITH KEY fieldname = gs_fieldcat-fieldname.
IF sy-subrc = 0.
gs_fieldcat-row_pos = ls_fieldcat-row_pos.
gs_fieldcat-col_pos = ls_fieldcat-col_pos.
gs_fieldcat-no_out = ls_fieldcat-no_out.
MODIFY gt_fieldcat FROM gs_fieldcat INDEX sy-tabix.
CLEAR gs_fieldcat.
ENDIF.
ENDLOOP.
*C-- Clear the disvariant for the background job as it contains the ALV
*C-- layout varinat
CLEAR gs_disvariant.
gs_disvariant-report = 'ZGPPMP0001'.
Then pass gt_fieldcat to 'REUSE_ALV_GRID_DISPLAY'.
The reason i'm doing it this way is that when we pass the layout variant name, the contents in gt_fieldcat were getting modified.
One more thing i'd like to point out is that that, i tried to delete the fields with no_out = 'x'. Now when i ran the program in background with all the fields in sort catalog (suppose there are 2 fields field1 and field2) also in fieldcatalog it ran fine. In the next run in background i removed one of the fields in sort catalog from the fieldcatalog (delete the fields with no_out = 'x') and i got dump. Basically i had hidden field1 and so the code which was deleting fields with no_out = 'x' deleted this field from gt_fieldcat. So basically we should not delete fields with no_out = 'x'.
I was getting ABAP runtime errors MESSAGE_TYPE_X in the following part of the standard code.
000310 LOOP AT CT_SORT INTO LS_SORT.
000320
000330 READ TABLE IT_FIELDCAT ASSIGNING <LS_FIELDCAT>
000340 WITH KEY FIELDNAME = LS_SORT-FIELDNAME BINARY SEARCH.
000350 IF SY-SUBRC NE 0.
> MESSAGE X000(0K).
000370 ENDIF.
000380
000390 LS_SORT-SELTEXT = <LS_FIELDCAT>-SELTEXT.
i have just mentioned this part because when i checked the forum many people were getting such errors "MESSAGE_TYPE_X". This could also be one of the reasons. -
Clearing of ALV output is not happening in one side of the output.
Hi All,
I have created a simple upload program and using a Post button I am posting the Material Document. I have uploaded the file, I am using a ALV splitter to display the output ( Line Item in left panel and Message log in the right panel).
If I upload another Excel file on the same screen, and click on 'Upload' button, left panel is getting refreshed with new set of line items whereas in the Right Panel Message Log details of First uploaded file is present, it is not getting refreshed.
I used Free(), Refresh and Refresh_Table_dsiplay keywords to clear it, but its not working.
In debug mode, If I see the internal table which is used to store the Message Log Details is empty, but the message is still present in the ALV output for newly uploaded file.
Kindly give your valuable inputs.
Thanks & Regards,
Karthikeyan G.Hello Karthikeyan G,
have you tried to cl_gui_cfw=>flush after your Refresh_Table_Display?
Also,when you write ALV splitter, did you use easy-splitter or the regular splitter container?
You ran the methods against the correct instance, right
Hope that helps,
Frank. -
Output message not coming automatically for PO
hi
i cerated new output message sending PO to vendor by e-mail. I maintained condition records in MN04. Condition table, access sequence all are maintained. I included new output type into the control data of the existing schema RMBEF1 and the schema is assigned to PO also. Also maintain entry in following string SPRO- Material Management-Purchasing-Messages-Output control-Message Types-Define Message type for PO---Fine-Tuned Control: Purchase Order
Still the output message is not coming automatically while creating PO every time i add output type namually. please guide
regardsHope you have maintained condition for combination. preferrably -
1) Purch Doc type > PORG > Vendor
2) Please make sure that, you have maintained the fileds which are relavant for output.(if you are making any changes in existing PO and you need output)
Hope this will help you -
Default output device not coming
I made one PDF form and attached it in List LG01 in CB85 to print process order through COR2 output device is mentioned as LP01 in list Lg01, but while printing, output device is coming as which is mentioned in user profile.
I want that output device which i mentioned in configuration should come as default during printing through COR2....Pl. help
Edited by: lisa harley on Feb 26, 2010 11:09 AMHello,
Please check the below settings at "Printer Specification" for CB85,
If output device = 1 ,then it will select the output device for user profile
if output device = 2 , Output device from configuration, ie CB85
Regards
Pradeep -
Output is not coming for a specific billing documnet no
Hi,
I am not able to get the out put of a smartform for a specific billing document number.For othe documents output is coming.
For that specific billing document no ,the field are showing '#' mostly.Evenif i am not giving any conditions then also its showing
#.Its not showing the output for the page no even.
Can u please suggest something..
Thanks.Try to debug the smartform.
Put a break point in the smartform and then try to execute. check for the value. Check it out. -
HTML formatted output is not coming as an attachment in the mail
Hi,
We have a requirement where we have designed xslt template and generating the HTML output. In the report server/ local machine we are able to get the report as a file, but when we are scheduling the report and setting email as the delivery method we are able to get the report, but the report will be coming in the email content instead as an attachment.
Please let me know whether we need to do any setting or configuration changes in the report server to get the report as an attachment to the email.
Thanks,
Kamath.Hello Kamath,
Have you set PARAMETER6 to true or false?
http://docs.oracle.com/cd/E28280_01/bi.1111/e22258/add_burst_def.htm#CHEJDGAG
Please send us your bursting query so we can check it.
For more info on this, please review section 7.3 Adding a Bursting Definition to Your Data Model
from Fusion Middleware Data Modeling Guide for Oracle Business Intelligence Publisher
http://docs.oracle.com/cd/E28280_01/bi.1111/e22258/add_burst_def.htm#BIPDM347
Bogdan -
Output type not coming automatically
HI
Whenever i am creating using t.code mb11 t.code i have to give output type wa03 manually,is this possible automaticaly output type generation in mb11 t.code
Below settings also i completed
NACE-Select ME Click on Condition records- Select WA03-Trans/Event Type-"WA" Print Version " 2" and Execute it
In the next scren P-1, madium-1, Language EN and enter,, Now select the line and click on the communication method LP01 and save it,,
Regards
samHi
Bijay and nisha thanks for reply still not come my output type automaticaly,i have completed my configuration in omj3 t.code for my plant and storage location.nacz t.code i give 173 GR/GI requirement,
Regards
sam -
Newly added field not getting displayed in ALV output
Hi All,
I'm adding one more field/column to be displayed in an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
DATA: BEGIN OF it_salary OCCURS 0,
pernr LIKE pa0000-pernr,
ename LIKE pa0001-ename,
rtext like lv_rtext, -
added field
waers LIKE pa0008-waers
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = driver
i_internal_tabname = 'IT_SALARY'
i_client_never_display = 'X'
i_inclname = driver
CHANGING
ct_fieldcat = lv_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = driver
it_fieldcat = lv_fieldcat[]
i_default = 'X'
i_save = 'A'
is_variant = lv_tmplt
is_layout = lv_ls_layout
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_salary
EXCEPTIONS
program_error = 1
OTHERS = 2.
The newly added field is not getting populated in the lv_fieldcat table. Tried running programs BALVBUFDEL,
BCALV_BUFFER_DEL_SHARED then logging off and logging in but of no help.
Please provide suggestion for this issue.
Regards,
Sridevi SHi,
Fieldcat is buffered - so use
I_BYPASSING_BUFFER = 'X'
Since a while CL_GUI_ALV_GRID is available which does NOT need any fieldcat (is determined internally using RTTI). It is worth playing around whith this class if you have some time. This class is recommended for ALV Output by SAP (but no edit is possible - was never supported officially).
A simple use would be:
data: gt_output type standard table of (adjust!).
*simple ALV output
data go_alv type ref to cl_salv_table.
data go_functions type ref to cl_salv_functions_list.
data go_columns type ref to cl_salv_columns_table.
data go_column type ref to cl_salv_column_table.
*Exceprion handlig
data: go_exception type ref to cx_root,
gv_errortext type string.
** fill table gt_output ...
** ALV output
if not gt_output is initial.
try.
call method cl_salv_table=>factory
importing
r_salv_table = go_alv
changing
t_table = gt_output.
catch cx_salv_msg into go_exception.
gv_errortext = go_exception->get_text( ).
message gv_errortext type 'A'.
endtry.
* enable all standard ALV functions
go_functions = go_alv->get_functions( ).
go_functions->set_all( ).
* hide MANDT
go_columns = go_alv->get_columns( ).
go_column ?= go_columns->get_column( columnname = 'MANDT' ).
go_column->set_technical( ).
go_alv->display( ).
Kind regards,
Holger -
How to get ALV Output with selected Layout
I have a program which displays the output in ALV list format and i changed the layout and saved
In the selection-screen i have a field to select the layout after selecting the layout it output is not coming with that layout
can anyone tell me what is the problem
or give me a sample code
Thank youHi,
Check this code.
Hope it helps.
*& Report zSALES_ORDER
report z_sales_order.
type-pools: slis.
*DATA DECLARATION.
types: begin of i_vbak,
vbeln type vbeln_va,
augru type augru,
erdat type erdat,
end of i_vbak.
types: begin of i_vbap,
vbeln type vbeln_va,
augru type augru,
posnr type posnr_va,
matnr type matnr,
zmeng type dzmeng,
end of i_vbap.
types: begin of i_makt,
matnr type matnr,
maktx type maktx,
end of i_makt.
types: begin of i_lips,
posnr type posnr_vl,
matnr type matnr,
lfimg type lfimg,
end of i_lips.
types: begin of i_reason,
spras type spras,
augru type augru,
bezei type bezei40,
end of i_reason.
types: begin of i_vbpa,
vbeln type vbeln,
parvw type parvw,
kunnr type kunnr,
end of i_vbpa.
types: begin of i_kna1,
kunnr type kunnr,
name1 type name1_gp,
end of i_kna1.
types: begin of i_final,
vbeln type vbeln_va,
posnr type posnr_va,
matnr type matnr,
zmeng type dzmeng,
maktx type maktx,
lfimg type lfimg,
spras type spras,
augru type augru,
bezei type bezei40,
parvw type parvw,
kunnr type kunnr,
name1 type name1_gp,
end of i_final.
*INTERNAL TABLES
data: it_vbak type standard table of i_vbak.
data: it_vbap type standard table of i_vbap.
data: it_makt type standard table of i_makt.
data: it_lips type standard table of i_lips.
data: it_vbpa type standard table of i_vbpa.
data: it_kna1 type standard table of i_kna1.
data: it_final type standard table of i_final.
data: it_reason type standard table of i_reason.
data : v_flag.
*WORK AREA
data: wa_vbak type i_vbak.
data: wa_vbap type i_vbap.
data: wa_makt type i_makt.
data: wa_lips type i_lips.
data: wa_vbpa type i_vbpa.
data: wa_kna1 type i_kna1.
data: wa_final type i_final.
data: wa_reason type i_reason.
*DATA DECLARATION.
data: v_progname type sy-repid.
data: v_vbeln type vbak-vbeln.
data: v_gridtitle type lvc_title.
*PARAMETERS: D_VARI LIKE DISVARIANT-VARIANT.
data: i_variant like disvariant.
data: p_vari like disvariant-variant.
*DATA DECLARATION FOR CATALOGS LAYOUT SORT EVENTCATALOG TOPOFPAGE.
data: i_fieldcat type slis_t_fieldcat_alv.
data: i_layout type slis_layout_alv.
data: i_sortinfo type slis_t_sortinfo_alv.
data: i_listheader type slis_t_listheader.
data: i_eventcat type slis_t_event.
*INITIALIZATION - First point of execution of program
To initialize Any variables that are to be
used in the program, even before selection screen
appears.
initialization.
v_progname = sy-repid.
v_flag = space.
perform z_default_variant.
*SELECTION SCREEN
selection-screen begin of block blk1 with frame title text-002.
select-options: s_vbeln for v_vbeln.
selection-screen end of block blk1.
*Variable for ALV Variant
selection-screen begin of block b_var with frame title text-020.
parameters: d_vari like disvariant-variant.
selection-screen end of block b_var.
*AT SLECTION-SCREEN.
at selection-screen.
perform z_validations.
*AT SELECTION SCREEN.
at selection-screen on d_vari.
CHECK FOR THE EXISTENCE OF THE VARIANT SELECTED
perform zf_check_var_exist.
at selection-screen on value-request for d_vari.
PROVIDE THE F4-HELP.
perform zf_variant_f4.
*START OF SELECTION.
start-of-selection.
perform z_select.
perform check_validation_flag.
perform z_fieldcat using i_fieldcat.
perform z_layout.
perform z_sortinfo using i_sortinfo.
perform z_eventcat using i_eventcat.
perform z_gridtitle.
perform z_listheader using i_listheader.
perform z_display.
*& Form Z_VALIDATIONS
text
--> p1 text
<-- p2 text
form z_validations .
select vbeln into v_vbeln
up to 1 rows
from vbak
where vbeln in s_vbeln.
endselect.
if sy-subrc <> 0.
message i002(sy) with 'No Records'.
v_flag = 'X'.
endif.
endform. " Z_VALIDATIONS
*& Form Z_FIELDCAT
text
-->P_I_FIELDCAT text
form z_fieldcat using p_i_fieldcat type slis_t_fieldcat_alv.
data: i_fieldcat type slis_fieldcat_alv.
*VBAK-VELN
i_fieldcat-col_pos = '1'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'VBELN'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-key = 'X'. " SO THAT THIS FIELD IS NOT SCROLLABLE AND HIDDABLE.
i_fieldcat-just = 'C'. " FOR JUSTIFICATION.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'SALES ORDER'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'VBAK'. " FOR F1 & F4 HELP AS REFERNCED TO THE DDIC TABLE.
append i_fieldcat to p_i_fieldcat.
*VBAP-SPRAS
i_fieldcat-col_pos = '2'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'SPRAS'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'LANGUAGE'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 5. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'TVAUT'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*VBAP-AUGRU
i_fieldcat-col_pos = '3'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'AUGRU'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'REASON'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 5. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'VBAK'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*VBAP-bezei
i_fieldcat-col_pos = '4'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'BEZEI'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'DESCRIPTION'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'TVAUT'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*VBAP-POSNR
i_fieldcat-col_pos = '5'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'POSNR'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'ITEM'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 8. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'VBAP'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*VBAP-MATNR.
i_fieldcat-col_pos = '6'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'MATNR'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'MATERIAL'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 10. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'VBAP'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*VBAP-ZMENG
i_fieldcat-col_pos = '7'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'ZMENG'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'QUANT'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 10. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'VBAP'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*MAKT-MAKTX
i_fieldcat-col_pos = '8'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'MAKTX'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'DESCRIPTION'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'MAKT'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*LIPS-VBELN
i_fieldcat-col_pos = '9'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'VBELN'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'DELIVERY'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'LIPS'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*LIPS-LFIMG
i_fieldcat-col_pos = '10'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'LFIMG'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-do_sum = 'X'.
i_fieldcat-seltext_l = 'LFIMG'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 18. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'LIPS'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*parvw
i_fieldcat-col_pos = '11'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'PARVW'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'PARTNER FUN'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 18. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'VBPA'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*KUNNR
i_fieldcat-col_pos = '12'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'KUNNR'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'SHIP'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 18. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'VBPA'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
*NAME1
i_fieldcat-col_pos = '13'. " POSITION OF THE COLUMN.
i_fieldcat-fieldname = 'NAME1'. " FIELD FOR WHICH CATALOG ID FILLED.
i_fieldcat-tabname = 'IT_FINAL'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
i_fieldcat-lzero = 'X'. " OUTPUT WITH LEADING ZEROS.
i_fieldcat-seltext_l = 'NAME'. " LONG TEXT FOR HEADER.
i_fieldcat-outputlen = 18. " SET THE OUTPUT LENGTH.
i_fieldcat-ref_tabname = 'KNA1'. " FOR F1 & F4 HELP AS REFERNCED TO TABLE.
append i_fieldcat to p_i_fieldcat.
endform. " Z_FIELDCAT
*& Form Z_SELECT
text
--> p1 text
<-- p2 text
form z_select .
select vbeln
augru erdat into corresponding fields of table it_vbak
from vbak
where vbeln in s_vbeln.
loop at it_vbak into wa_vbak.
wa_vbak-erdat = '99991231'.
modify it_vbak from wa_vbak transporting erdat.
endloop.
select * from vbak into corresponding fields of table it_vbak
for all entries in it_vbak
where erdat = it_vbak-erdat.
if sy-subrc = 0.
select vbeln
posnr
matnr
zmeng into corresponding fields of table it_vbap
from vbap
for all entries in it_vbak
where vbeln = it_vbak-vbeln.
if sy-subrc = 0.
select spras
augru
bezei into corresponding fields of table it_reason
from tvaut
for all entries in it_vbak
where augru = it_vbak-augru.
if sy-subrc = 0.
select vbeln
parvw
kunnr into corresponding fields of table it_vbpa
from vbpa
for all entries in it_vbak
where vbeln = it_vbak-vbeln.
if sy-subrc = 0.
select kunnr
name1 into corresponding fields of table it_kna1
from kna1
for all entries in it_vbpa
where kunnr = it_vbpa-kunnr.
if sy-subrc = 0.
select posnr
matnr
lfimg into corresponding fields of table it_lips
from lips
for all entries in it_vbap
where posnr = it_vbap-posnr.
if sy-subrc = 0.
select matnr
maktx into corresponding fields of table it_makt
from makt
for all entries in it_vbap
where matnr = it_vbap-matnr.
endif.
endif.
endif.
endif.
endif.
else.
message i002(sy) with 'No Data found'.
leave list-processing.
endif.
if sy-subrc = 0.
loop at it_vbap into wa_vbap.
read table it_vbak into wa_vbak with key vbeln = wa_vbap-vbeln binary search.
if sy-subrc = 0.
*MOVE DATA INTO IT_FINAL.
move: wa_vbak-vbeln to wa_final-vbeln,
wa_vbak-augru to wa_final-augru,
wa_vbap-posnr to wa_final-posnr,
wa_vbap-matnr to wa_final-matnr,
wa_vbap-zmeng to wa_final-zmeng.
endif.
read table it_lips into wa_lips with key posnr = wa_final-posnr binary search.
if sy-subrc = 0.
move: wa_lips-lfimg to wa_final-lfimg.
endif.
read table it_reason into wa_reason with key augru = wa_final-augru binary search.
if sy-subrc = 0.
move: wa_reason-spras to wa_final-spras,
wa_reason-bezei to wa_final-bezei.
endif.
read table it_makt into wa_makt with key matnr = wa_final-matnr binary search.
if sy-subrc = 0.
move: wa_makt-maktx to wa_final-maktx.
endif.
read table it_vbpa into wa_vbpa with key vbeln = wa_final-vbeln binary search.
if sy-subrc = 0.
move: wa_vbpa-parvw to wa_final-parvw,
wa_vbpa-kunnr to wa_final-kunnr.
endif.
read table it_kna1 into wa_kna1 with key kunnr = wa_final-kunnr binary search.
if sy-subrc = 0.
move: wa_kna1-name1 to wa_final-name1.
endif.
append wa_final to it_final.
clear wa_final.
endloop.
endif.
endform. " Z_SELECT
*& Form Z_LAYOUT
text
--> p1 text
<-- p2 text
form z_layout .
i_layout-zebra = 'X'.
i_layout-totals_text = 'Total'(a00).
i_layout-subtotals_text = 'SubTotal'(a01).
i_layout-box_tabname = 'IT_FINAL'.
endform. " Z_LAYOUT
*& Form Z_SORTINFO
text
-->P_I_SORTINFO text
form z_sortinfo using p_i_sortinfo type slis_t_sortinfo_alv.
data: i_sortinfo type slis_sortinfo_alv.
clear i_sortinfo.
i_sortinfo-spos = '1'.
i_sortinfo-fieldname = 'VBELN'.
i_sortinfo-tabname = 'IT_FINAL'.
i_sortinfo-up = 'X'.
i_sortinfo-group = 'UL'. " I.E UNDERLINE AFTER EVERY GROUP
i_sortinfo-subtot = 'X'.
append i_sortinfo to p_i_sortinfo.
endform. " Z_SORTINFO
*& Form Z_EVENTCAT
text
-->P_I_EVENTCAT text
form z_eventcat using p_i_eventcat type slis_t_event.
data: i_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = p_i_eventcat
exceptions
list_type_wrong = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
clear i_event.
read table p_i_eventcat with key name = slis_ev_top_of_page into
i_event.
if sy-subrc = 0.
move 'TOP_OF_PAGE' to i_event-form.
append i_event to p_i_eventcat.
endif.
read table p_i_eventcat with key name = slis_ev_pf_status_set into i_event.
if sy-subrc = 0.
move 'SET_PF_STATUS' to i_event-form.
append i_event to p_i_eventcat.
endif.
clear i_event.
read table p_i_eventcat into i_event with key name = slis_ev_user_command .
if sy-subrc = 0.
move 'USER_COMMAND' to i_event-form.
append i_event to p_i_eventcat.
endif.
endform. " Z_EVENTCAT
*& Form Z_DISPLAY
text
--> p1 text
<-- p2 text
form z_display .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = v_progname
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = v_gridtitle
i_save = 'A'
is_layout = i_layout
it_fieldcat = i_fieldcat[]
it_sort = i_sortinfo
it_events = i_eventcat
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = it_final
exceptions
program_error = 1
others = 2
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " Z_DISPLAY
*& Form Z_GRIDTITLE
text
--> p1 text
<-- p2 text
form z_gridtitle .
v_gridtitle = 'ALV FOR SALES ORDER DISPLAY'.
endform. " Z_GRIDTITLE
*TOP OF PAGE.
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = i_listheader.
endform. "TOP_OF_PAGE
*MENU SETTINGS.
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'ALV_MENU'.
endform. "SET_PF_STATUS
*USER-COMMAND
form user_command using p_ucomm type sy-ucomm
rs_selfield type slis_selfield.
data : vbeln type vbeln_va.
case p_ucomm.
when 'BACK'.
leave program.
when '&IC1'.
clear : vbeln.
vbeln = rs_selfield-value.
set parameter id: 'AUN' field vbeln.
call transaction 'VA03' and skip first screen.
endcase.
endform. " USER_COMMAND
*& Form Z_LISTHEADER
text
-->P_I_LISTHEADER text
form z_listheader using p_i_listheader type slis_t_listheader.
data: l_listheader type slis_listheader.
refresh p_i_listheader.
clear l_listheader.
l_listheader-typ = 'H'.
l_listheader-info = text-001.
append l_listheader to p_i_listheader.
clear l_listheader.
l_listheader-typ = 'H'.
l_listheader-info = text-002.
append l_listheader to p_i_listheader.
endform. " Z_LISTHEADER
*& Form check_validation_flag
text
--> p1 text
<-- p2 text
form check_validation_flag .
if not v_flag is initial.
leave list-processing.
endif.
endform. " check_validation_flag
*& Form Z_DEFAULT_VARIANT
text
--> p1 text
<-- p2 text
form z_default_variant .
i_variant-report = v_progname.
call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
exporting
i_save = 'A'
changing
cs_variant = i_variant
exceptions
wrong_input = 1
not_found = 2
program_error = 3
others = 4.
if sy-subrc = 0.
p_vari = i_variant-variant.
D_VARI = P_VARI.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " Z_DEFAULT_VARIANT
*& Form ZF_CHECK_VAR_EXIST
text
--> p1 text
<-- p2 text
form zf_check_var_exist .
data: l_variant like disvariant.
if not p_vari is initial.
clear l_variant.
l_variant-report = v_progname.
l_variant-variant = p_vari.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = 'U'
changing
cs_variant = l_variant
exceptions
wrong_input = 1
not_found = 2
program_error = 3
others = 4.
if sy-subrc = 0.
clear i_variant.
move: l_variant-variant to i_variant-variant,
l_variant-report to i_variant-report.
else.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
endform. " ZF_CHECK_VAR_EXIST
*& Form ZF_VARIANT_F4
text
--> p1 text
<-- p2 text
form zf_variant_f4 .
data: x_variant like disvariant.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = i_variant
I_TABNAME_HEADER =
I_TABNAME_ITEM =
IT_DEFAULT_FIELDCAT =
i_save = 'U'
i_display_via_grid = 'X'
importing
E_EXIT =
es_variant = x_variant
exceptions
not_found = 1
program_error = 2
others = 3
if sy-subrc = 0.
p_vari = x_variant-variant.
d_vari = p_vari.
clear i_variant.
move: x_variant-variant to i_variant-variant,
x_variant-report to i_variant-report.
else.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " ZF_VARIANT_F4
Regards,
Pritha. -
Footer not coming end of the page in BI Publisher
Hi All,
I am developing a report in which the footer output is not coming end of the page after the tabular output per group Completion.
There is a tabular group and free form group which output coming accourding to number of lines in tabular output but after the tabular output there is one
more group in the form of tabular which show the details sum of the first tabular output which i have to print each of the group end and end of that page but
when i am trying to get output it coming just after the first tabular output.
Please advice...
Regards,
Sushantyou have to use the word footer and header, and put these place-holders there
better send me the template and xml, { i guess.}i know what you are trying -
Out put its not coming in PL/SQL
Hi
i have one PL/SQL coding i excuted sucessfully but i'm not getting out put.i created one table and insert the values also.but still .output its not coming.my question is
(i)i want to display all the employee name and salary of all the employees
SQL> create table empdet
2 (ename varchar2(15),
3 salary number(8,3),
4 dept varchar2(14));
Table created.
SQL> insert into values('vijay',10000,'manager');
insert into values('vijay',10000,'manager')
ERROR at line 1:
ORA-00903: invalid table name
SQL> ed
Wrote file afiedt.buf
1* insert into empdet values('vijay',10000,'manager')
SQL> /
1 row created.
SQL> begin
2 for empdet in (select ename,salary from employee)
3 loop
4 dbms_output.put_line(empdet.ename||''||empdet.salary);
5 end loop;
6 end;
7 /
PL/SQL procedure successfully completed.
Note:
1.i creat the table
2.insert the values
3.i exectuted PL/SQL query but output its not coming.i did but agine same problem out put its not coming.if u don't mine can u exectue this query in ur system
SQL> SET SERVEROUTPUT ON
SQL> begin
2 2 for empdet in (select ename,salary from employee)
3 3 loop
4 4 dbms_output.put_line(empdet.ename||''||empdet.salary);
5 5 end loop;
6 6 end;
7 /
2 for empdet in (select ename,salary from employee)
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00103: Encountered the symbol "2" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge
<a single-quoted SQL string> pipe
The symbol "2" was ignored.
ORA-06550: line 3, column 1:
PLS-00103: Encountered the symbol "3" when expecting one of the following:
loop -
Modify ME55 selection conditions and ALV output
Hi guys,
I need to modify ME55 transaction, i mean to modify the data selection and ALV report to add new columns, is it possible with some enhancement or should i copy the program RM06BF00?
The problem that i faced when copying ME55 transaction is that copy ALV output is not the same in the standard one, is it possible to copy the class LCL_FACTORY?
Any link or idea would be helpful, thank u in advance.
Sofiane.hi,
You have to copy the standard program SAPMV75A to ZSAPMV75A, change them accordingly. -
ALV report value is not coming in output
Hi all,
I have developed one ALV report using ABAP OOPS. i have used Custom Container to display my all values.
below are the methods i am calling to dispaly and all values is coming in T_DATASET[] ans fcat, But after Executing my report it is not displaying any value.
my container is blank in output only fcat-coltext is coming and fieldname value is not coming.
wa_fcat-fieldname = 'T_DATASET-KAVS'.
wa_fcat-coltext = ' '.
CALL METHOD grid1->set_table_for_first_display
CHANGING
it_outtab = T_DATASET[]
it_fieldcatalog = fcat.
please guide me.
Thanks in Advance.Check below code. And make sure you code below steps before calling set table for first display.
IF G_CUSTOM_CONTAINER1 IS INITIAL.
* create container for ALV grid1
CREATE OBJECT G_CUSTOM_CONTAINER1
EXPORTING
CONTAINER_NAME = 'CUST_CONT'.
else.
ENDIF.
IF GRID1 IS INITIAL.
* create ALV grid
CREATE OBJECT GRID1
EXPORTING
I_APPL_EVENTS = SELECTED "application event
I_PARENT = G_CUSTOM_CONTAINER1.
G_LAYOUT1-EDIT = 'X'.
G_LAYOUT1-sel_mode = '3'.
G_LAYOUT1-NO_TOOLBAR = 'X'.
G_LAYOUT1-ZEBRA = 'X'.
G_LAYOUT1-info_fname = 'ROWCOLOR'.
G_LAYOUT1-GRID_TITLE = TEXT-006.
G_LAYOUT1-STYLEFNAME = 'CELLTAB'.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING IS_LAYOUT = G_LAYOUT1
IT_TOOLBAR_EXCLUDING = GT_TOOLBAR_EXCLUDING
CHANGING IT_FIELDCATALOG = GT_FIELDCAT_LVC[]
IT_OUTTAB = CONP[]. -
Header is not coming in alv list display- urgent
hi all,
i am sending my code below....
my requirement is in selection screen i have 4 radio buttons . if i click 1 radio button it will duiisplay data and and its header. report is working fine. my requirement id when i click r_mssng radio button(missing radio button) it is showing data correctsly. here i want to show header as 'Missing details report'.
this is not coming in my report. anybody can suggest me.
i am sending my code below....
report zvra0001ftb13 message-id zv.
Confidential and Proprietary
* Celestica Corporation
* All Rights Reserved
*ABAP Name: ZVRA0001FTB13
*Created by: Srinivasa Chakravarthi
*Created on: 26/03/2003
*SAP Version: 4.6 C
*Description: This report displays details of foreign trades
and EHS based on the deliveries made to the outside
countries.
*Input: Selection Screen Criteria includes country of
origin,Company code, Sales Organisation,
Ship-to-party, Sold-to-paarty, Goods movement date,
Invoice number, Invoice type, Material , Material
Type, Exporter ID, Province of origin.
*Output: ALV output that contains Mode of Transport, Export
HS number, Commodity Description, Quantity, UOM,
Value, Country of Destination, Goods Origin
*Dependency: Nil
*Modification Log:
*CR# Date Coded Transport Description
*====== ======== ========= ============= ===============================
*5147 26/03/2003 Srinivas ED1K922286 New Development
*8700 02/11/2004 H.Arular ED1K938380 To check if entries of Comm
Code(HS code)is less than 8
digits and give a warning
message.
*18684 25/07/2007 MAHEEDHAR Merge the logic from report
ZVRA0001FTB13_ERROR into
report ZVRA0001FTB13 and
added two radio buttons
called missing data and non
missing data, addedc logic
accoriding to the radio
buttons.
*Declaring Tables.
tables: likp, "Delivery document Header
lips, "Delivery Document Item
vbfa, "Sales document Flow
bkpf, "Accounting Document Header
eikp, "Foreign Trade:Export/Import Data
eipo, "Foreign Trade:Export/ Import
"Header data
t618t, "Forein Trade:Mode of Transport
"Description
t604t, "Foreign Trade: Commodity Code/
"Import Code number Description.
mara, "Material master data.
t005, "Countries
t001, "Company Codes
tvko, "Sales Organisations
kna1, "Customer Master
t003, "Document types
t134, "Material types
tvfk,
konv,
vbrk.
constants : c_rep like vbrk-fkart value 'YGFB',
c_for(10) value 'Foreign'.
*Decalre Type pool for ALV
type-pools: slis.
*Type declaration for LIKP.
types: begin of t_data1,
vbeln like likp-vbeln, "Delivery
kunnr like likp-kunnr,
end of t_data1.
*Type declaration for LIPS,VBFA.
types: begin of t_data2,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
vbelv like vbfa-vbelv, "Preceding SD document
posnv like vbfa-posnv, "Preceding item of SD document
matnr like lips-matnr, "Material Number
meins like lips-meins, "Base unit of measure
lfimg like lips-lfimg, "Actual Quantity Delivered
mtart like mara-mtart,
end of t_data2.
**Type declaration for BKPF.
*types: begin of t_data3,
belnr like bkpf-belnr, "Accounting Documnet number
bukrs like bkpf-bukrs, "Company Code
end of t_data3.
*Type declaration for BKPF.
types: begin of t_data3,
vbeln like vbrk-belnr, " Billing Doc
fkart like vbrk-fkart,
land1 like vbrk-land1,
end of t_data3.
*Type declaration for EIPO.
types: begin of t_data4,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
matnr like vbrp-matnr,
fkimg like vbrp-fkimg,
meins like vbrp-meins,
verld like eipo-verld, "Country of dispatch for Foreign
"trade
herkl like eipo-herkl, "Country of origin of material
grwrt like eipo-grwrt, "Statistical value for Foreign
" trade
stawn like eipo-stawn, "Commodity code for foreign trade
expvz like eikp-expvz, "Mode of transport for foreign
"trade
end of t_data4.
*Type declaration for T618T.
types: begin of t_data5,
land1 like t618t-land1, "Country key
expvz like t618t-expvz, "Mode of Transport
bezei like t618t-bezei, "Description
end of t_data5.
*Type declaration for T604T.
types: begin of t_data6,
land1 like t604t-land1, "Country key
stawn like t604t-stawn, "Commodity Code
text1 like t604t-text1, "Description
end of t_data6.
*Type declaration for T604T.
types: begin of t_mara,
matnr like mara-matnr,
end of t_mara.
types : begin of rep_val,
vbelv like vbfa-vbelv,
posnv like vbfa-posnv,
vbeln like vbfa-vbeln,
posnn like vbfa-posnn,
uepos like vbap-uepos,
posnr like vbap-posnr,
netwr like vbap-netwr,
end of rep_val.
types : begin of t_price,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
knumv like konv-knumv,
kposn like konv-kposn,
kbetr like konv-kbetr,
kpein like konv-kpein,
end of t_price.
data : t_sord type rep_val occurs 0 with header line.
data : t_dord type rep_val occurs 0 with header line.
data : t_rord type rep_val occurs 0 with header line.
data : t_hord type rep_val occurs 0 with header line.
data : t_ford type rep_val occurs 0 with header line.
data : i_price type t_price occurs 0 with header line.
data : i_price1 type t_price occurs 0 with header line.
data : i_mara type t_mara occurs 0 with header line.
data : i_sort type slis_t_sortinfo_alv.
DATA: t_layout TYPE slis_layout_alv.
*Declaring Selection screen.
selection-screen begin of block b1 with frame title text-101.
select-options:
s_verld for eipo-verld, "Country of Dest.
s_bukrs for bkpf-bukrs, "Company code
s_vkorg for likp-vkorg, "Sales Organisation
s_kunnr for likp-kunnr, "Ship-to-Party
s_kunag for likp-kunag, "Sold-to-party
s_wadat for likp-wadat_ist, "Goods Movement date
s_belnr for vbrk-vbeln, "Invoice number
s_blart for vbrk-fkart. "Invoice type.
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-101.
select-options:
s_matnr for mara-matnr, "Material
s_mtart for mara-mtart. "Material Type
selection-screen end of block b2.
selection-screen begin of block b3 with frame title text-101.
parameters:
p_export(30) type c default '1366770724RM' obligatory , "Exporter ID
p_provi(30) type c default 'ONTARIO' obligatory ,
p_sumid(30) type c default 'SUM0704'.
"Province of Origin
selection-screen end of block b3.
selection-screen begin of block b4 with frame title text-104.
parameters:
r_summ radiobutton group zsum,
r_dets radiobutton group zsum,
r_mssng radiobutton group zsum, " maheedhar
R_NMSNG RADIOBUTTON GROUP ZSUM. " MAHEEDHAR
selection-screen skip.
parameter : p_sum as checkbox .
selection-screen end of block b4.
selection-screen begin of block b5 with frame title text-105.
select-options : s_i_kun for likp-kunnr.
selection-screen end of block b5.
*Data Declaration
data: i_fieldcat type slis_t_fieldcat_alv.
data: l_fieldcat type slis_fieldcat_alv .
data: v_lin type i.
data: v_lfstk type c value 'C'.
data: v_vbtyp type c value 'U'.
data: i_data1 type t_data1 occurs 0 with header line.
data : begin of t_T005t occurs 0.
include structure t005t.
data : end of t_t005t.
data: i_data2 type t_data2 occurs 0 with header line.
data: t_delv type t_data2 occurs 0 with header line.
data: t_bild type t_data2 occurs 0 with header line.
data: i_data3 type t_data3 occurs 0 with header line.
data: i_data4 type t_data4 occurs 0 with header line.
data: i_data5 type t_data5 occurs 0 with header line.
data: i_data6 type t_data6 occurs 0 with header line.
*Declare Internal table for ALV output.
data: begin of i_output occurs 0,
belnr like vbrk-vbeln,
posnr like vbrp-posnr,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
strlen, "ED1K938380
end of i_output.
maheedhar-start.
data : i_output1 like i_output occurs 0 with header line,
i_output2 like i_output occurs 0 with header line.
maheedhar-end
data : buff_out like i_output occurs 0 with header line.
data: begin of t_outsum occurs 0,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
end of t_outsum.
data : v_ans.
data : variante LIKE disvariant.
data : v_repid LIKE sy-repid.
data : wa_listheader TYPE slis_listheader.
data : t_listheader TYPE slis_t_listheader.
data : b_text(250).
data: evntS type slis_t_event with header line. " MAHEEDHAR
EVENT AT SELECTION-SCREEN
at selection-screen.
*For Autorisation check
perform authorisation_check.
Validation of Selection screen
perform check_entry.
EVENT START-OF-SELECTION
start-of-selection.
*Get data
perform select_data.
**For calling ALV function modules
MAHEEDHAR - START
if r_mssng eq 'X'.
DELETE I_OUTPUT WHERE BEZEI NE SPACE AND
STAWN NE SPACE AND
HERKL NE SPACE AND
VERLD NE SPACE.
DESCRIBE TABLE I_OUTPUT LINES V_LIN.
IF V_LIN > 0.
PERFORM DISPLAY_OUTPUT.
ELSE.
MESSAGE E000 WITH TEXT-130.
ENDIF.
elseif R_SUMM eq 'X' OR R_DETS EQ 'X'. "ENDIF. " MAHEEDHAR
MAHEEDHAR-END
describe table i_output lines v_lin.
if v_lin > 0.
buff_out[] = i_output[].
Begin of ED1K938380
delete buff_out where stawn ne space or "ED1K938380
verld eq space or
herkl eq space.
delete buff_out where strlen ne 'X' or
verld eq space or
herkl eq space.
End of ED1K938380
describe table buff_out lines v_lin.
Lines with no commodity code exists.
if v_lin gt 0.
concatenate text-902 text-903 into b_text.
concatenate text-906 text-907 into b_text. "ED1K938380
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = Text-901
TEXT_QUESTION = b_text
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = v_ans.
if v_ans eq '1'.
perform display_output.
endif.
else.
perform display_output.
endif.
else. " MAHEEDHAR
message e000 with text-130.
endif.
MAHEEDHAR-START
*"-- If non missing details radiobutton is selected
elseif r_nmsng = 'X'.
*"-- move data from i_output to i_output1.
i_output1[] = i_output[].
sort i_output by belnr.
sort i_output1 by belnr.
*"-- to get missing data
delete i_output1 where bezei ne space and
stawn ne space and
herkl ne space and
verld ne space.
loop at i_output.
*"-- compare two int tables with respective document number
read table i_output1 with key belnr = i_output-belnr.
if sy-subrc ne 0.
move-corresponding i_output to i_output2.
append i_output2.
clear i_output2.
endif.
endloop.
describe table i_output2 lines v_lin.
if v_lin gt 0.
perform display_output.
else.
message e000 with text-130.
endif.
MAHEEDHAR-END.
ENDIF. " MAHEEDHAR
FORM SELECT_DATA *
form select_data.
Data:l_strlen type i. "ED1K938380
*Get details from LIKP.
if s_i_kun[] is initial.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' .
else.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
( ( likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' )
or
likp~kunnr in s_i_kun and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' ) .
endif.
if sy-subrc ne 0.
message e000 with text-200.
endif.
*Get details from table LIPS
select lips~vbeln
lips~posnr
vbfa~vbeln
vbfa~posnn
lips~matnr
lips~meins
lips~lfimg
mara~mtart
from lips
inner join vbfa on vbfavbelv = lipsvbeln
and vbfaposnv = lipsposnr
inner join mara on maramatnr = lipsmatnr
into table i_data2
for all entries in i_data1
where
lips~vbeln = i_data1-vbeln and
lips~matnr in s_matnr and
vbfa~vbeln in s_belnr and
mara~mtart in s_mtart and
vbfa~vbtyp_n = 'U'.
if sy-subrc ne 0.
message e000 with text-201.
endif.
t_delv[] = i_data2[].
t_bild[] = i_data2[].
sort t_delv by vbeln.
delete adjacent duplicates from t_delv comparing vbeln.
sort t_bild by vbeln ascending vbelv descending.
delete adjacent duplicates from t_bild comparing vbeln.
*Get details of Accounting document number
select vbeln fkart land1 from vbrk
into table i_data3
for all entries in t_bild
where vbeln = t_bild-vbelv and
bukrs in s_bukrs and
fkart in s_blart and
vkorg in s_vkorg and " MAHEEDHAR
land1 in s_verld. " MAHEEDHAR
sort i_data3.
*Get details from EIPO.
select vbrp~vbeln
vbrp~posnr
vbrp~matnr
vbrp~fkimg
vbrp~meins
eipo~verld
eipo~herkl
eipo~grwrt
eipo~stawn
eikp~expvz
from eikp
inner join vbrp on vbrp~vbeln = eikp~refnr
inner join eipo on eikp~exnum = eipo~exnum
and eipo~expos = vbrp~posnr
into table i_data4 for all entries in i_data3
where vbrp~vbeln = i_data3-vbeln.
eipo~verld in s_verld.
if sy-subrc ne 0.
message e000 with text-201.
endif.
IF R_MSSNG NE 'X' or r_nmsng = 'X'. " MAHEEDHAR
perform get_price.
ENDIF. " MAHEEDHAR
Get details from T618T.
select land1
expvz
bezei
from t618t
into table i_data5
for all entries in i_data4
where
land1 = 'CA' and " Getting for Canada only
expvz = i_data4-expvz and
spras = sy-langu.
select matnr from mara into table i_mara where matnr in s_matnr
and mtart in s_mtart.
Get details from T604T.
select land1
stawn
text1
from t604t
into table i_data6
for all entries in i_data4
where
land1 = i_data4-VERLD and
stawn = i_data4-stawn and
spras = sy-langu.
select * from T005t into table t_T005t where spras = sy-langu.
loop at i_data3.
loop at i_data4 where vbeln eq i_data3-vbeln.
clear : i_data1, i_data2.
read table i_data2 with key vbelv = i_data4-vbeln
posnv = i_data4-posnr.
read table i_data1 with key vbeln = i_data2-vbeln.
if not s_i_kun[] is initial.
check ( ( i_data1-kunnr in s_i_kun ) or
( i_data3-land1 in s_verld ) ).
else.
check i_data3-land1 in s_verld .
endif.
read table i_mara with key matnr = i_data4-matnr.
if sy-subrc eq 0.
read table i_data5 with key expvz = i_data4-expvz .
land1 = i_data3-land1.
read table i_data6 with key stawn = i_data4-stawn
land1 = i_data4-VERLD.
move i_data4-vbeln to i_output-belnr.
move i_data4-posnr to i_output-posnr.
move i_data5-bezei to i_output-bezei.
move i_data6-text1 to i_output-text1.
Begin of ED1K938380.
l_strlen = strlen( i_data4-stawn ).
if l_strlen < 8.
move 'X' to i_output-strlen.
endif.
End of ED1K938380.
move i_data4-stawn to i_output-stawn.
move i_data4-meins to i_output-meins.
read table t_T005t with key land1 = i_data3-land1.
move t_t005t-landx to i_output-verld.
if p_sum eq space.
if i_data4-herkl ne 'CA'.
i_output-herkl = c_for.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
move i_data4-fkimg to i_output-quantity.
if i_data3-fkart eq c_rep.
read table t_dord with key vbeln = i_data4-vbeln
posnn = i_data4-posnr.
if sy-subrc eq 0.
read table t_sord with key vbeln = t_dord-vbelv
posnn = t_dord-posnv.
if sy-subrc eq 0.
read table t_hord with key vbeln = t_sord-vbelv
posnr = t_sord-posnv.
if sy-subrc eq 0.
read table t_ford with key vbeln = t_hord-vbeln
posnr = t_hord-uepos.
if sy-subrc eq 0.
read table i_price with key vbeln = t_ford-vbeln
posnr = t_ford-posnr.
if sy-subrc eq 0.
read table i_price1 with key knumv = i_price-knumv
kposn = t_ford-posnr.
if sy-subrc eq 0.
if i_price1-kpein ne 0.
i_output-value =
( i_price1-kbetr / i_price1-kpein ) *
i_data4-fkimg.
endif.
endif.
endif.
endif.
endif.
endif.
endif.
else.
move i_data4-grwrt to i_output-value.
endif.
append i_output.
clear i_output.
clear : i_data5, i_data6.
endif.
endloop.
endloop.
sort i_output by verld herkl bezei stawn.
endform.
FORM DISPLAY_OUTPUT *
This form is to create the ALV output
form display_output.
data: xevents type slis_t_event,
ls_event type slis_alv_event,
slis_ev_top_of_page type slis_formname value 'TOP_OF_PAGE',
slis_ev_end_of_list type slis_formname value 'END_OF_LIST'.
*Call Function 'REUSE_ALV_EVENTS' for top of page
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = xevents
EXCEPTIONS
list_type_wrong = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
read table xevents with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move slis_ev_top_of_page to ls_event-form.
append ls_event to xevents.
endif.
read table xevents with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move slis_ev_end_of_list to ls_event-form.
append ls_event to xevents.
endif.
if r_dets ne space.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BELNR'.
l_fieldcat-seltext_m = text-912.
l_fieldcat-seltext_l = text-912.
l_fieldcat-reptext_ddic = text-912.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '12'..
when 'POSNR'.
l_fieldcat-seltext_m = text-913.
l_fieldcat-seltext_l = text-913.
l_fieldcat-reptext_ddic = text-913.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '6'.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
is_layout = t_layout
i_save = 'A'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = i_output
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
else. " MAHEEDHAR
ELSEIF R_SUMM EQ 'X'. " MAHEEDHAR
sort i_output by verld herkl stawn bezei.
loop at i_output.
move-corresponding i_output to t_outsum.
collect t_outsum.
endloop.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'T_OUTSUM'
i_inclname = 'ZVRA0001FTB13'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-col_pos = '8'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
i_save = 'A'
is_layout = t_layout
i_default = 'X'
is_variant = variante
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = t_outsum
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
MAHEEDHAR-START.
*"-- if detail summary checkbox is selected
elseIF R_MSSNG = 'X'.
PERFORM PREPARE_HEADER.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
hi,
*& Report ZALV_FIELD_GRID1
REPORT ZALV_FIELD_GRID1
NO STANDARD PAGE HEADING.
TABLES MARA.
type-pools :slis.
TYPES : BEGIN OF TMARA ,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
ERSDA LIKE MARA-ERSDA,
color(4) type c,
SEL type c,
LIGHT TYPE C,
END OF TMARA.
TYPES: BEGIN OF TMAKT,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
MAKTG LIKE MAKT-MAKTG,
SEL TYPE C,
COLOR(4),
END OF TMAKT.
DATA: ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
wa_fieldcat type slis_fieldcat_alv,
fieldcat type slis_fieldcat_alv occurs 0,
i_layout type slis_layout_alv,
WA_LISTHEADER TYPE SLIS_LISTHEADER ,
i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
V_EVENTS TYPE SLIS_T_EVENT ,
WA_EVENT TYPE SLIS_ALV_EVENT,
I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
PRINT_CONT type slis_print_alv.
SELECTION SCREE
selection-screen begin of block screen1 with frame title TEXT-001.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN COMMENT /32(35) COMM1.
SELECTION-SCREEN ULINE /27(35).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS MATNR FOR MARA-MATNR.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN COMMENT /30(50) COMM2.
SELECTION-SCREEN ULINE /27(40).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
SELECTION-SCREEN SKIP.
selection-screen end of block screen1.
INITIALIZATION
INITIALIZATION.
MATNR-low = '23'.
MATNR-high = '1000'.
MATNR-option = 'BT'.
MATNR-sign = 'I'.
APPEND MATNR.
ERSDA-low = '20030124'.
ERSDA-high = '20050302' .
APPEND ERSDA.
PERFORM FILLFIELD.
PERFORM FILLLAYOUT.
PERFORM build_print_params.
PERFORM FILL_SORT.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
comm1 ='SELECT MATERIAL NUMBER RANGE'.
comm2 ='SELECT MATERIAL CREATION DATE'.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM READDATA.
PERFORM POPDATA.
*& Form READDATA
text
FORM READDATA .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-LOW
IMPORTING
OUTPUT = MATNR-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-HIGH
IMPORTING
OUTPUT = MATNR-HIGH.
SELECT MATNR
ERSDA
MEINS
FROM MARA
INTO CORRESPONDING FIELDS OF
TABLE ITAB
WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
LOOP AT ITAB.
data id_color type i VALUE 1.
data id_colors(2) type c.
IF ITAB-MATNR < '000000000000000100'.
ITAB-LIGHT = '1'.
ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
'000000000000000100' .
ITAB-LIGHT = '2'.
ELSE.
ITAB-LIGHT = '3'.
ENDIF.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab-color.
modify itab.
CLEAR ITAB.
endloop.
ENDFORM. " READDATA
Form FILLFIELD
FORM FILLFIELD .
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
WA_FIELDCAT-outputlen = 20.
WA_FIELDCAT-HOTSPOT = 'X'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
*WA_FIELDCAT-EMPHASIZE = 'C210'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-COL_POS = '2'.
*WA_FIELDCAT-EMPHASIZE = 'C510'.
WA_FIELDCAT-outputlen = 10.
wa_fieldcat-seltext_m = 'UNIT'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'ERSDA'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-outputlen = 15.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
*WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'CREAT DATE'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. "FILLFIELD
Setup print parameters
form build_print_params.
PRINT_CONT-reserve_lines = '3'. "Lines reserved for footer
PRINT_CONT-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
Form POPDATA
FORM POPDATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER-COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOPPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_MARA
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = V_EVENTS
IT_EVENT_EXIT =
IS_PRINT = PRINT_CONT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " POPDATA
Form TOPPAGE
FORM TOPPAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
ENDFORM. "TOPPAGE
Form FILLLAYOUT
FORM FILLLAYOUT .
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-lights_fieldname = 'LIGHT'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
I_LAYOUT-no_totalline = 'X'.
ENDFORM. "FILLLAYOUT
Form FILL_SORT
FORM FILL_SORT .
SORT-DOWN = 'X'.
SORT-SPOS = 1.
SORT-FIELDNAME = 'MATNR'.
SORT-tabname = 'MARA'.
APPEND SORT.
ENDFORM. " FILL_SORT
Form EVENT_CALL
FORM EVENT_CALL .
DATA: I_EVENT LIKE V_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " EVENT_CALL
Form POPULATE_EVENT
FORM POPULATE_EVENT .
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO WA_EVENT.
IF SY-SUBRC = 0.
move 'END_OF_PAGE' to WA_EVENT-FORM.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
endif.
ENDIF.
ENDFORM. "POPULATE_EVENT
FORM END_OF_PAGE.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
ENDFORM.
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CASE RS_SELFIELD-FIELDNAME.
when 'MATNR'.
read table itab with key matnr = RS_SELFIELD-VALUE.
if sy-subrc = 0.
PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
PERFORM BUILD_FIELDCATLOG_MAKT.
PERFORM FILLLAYOUT_MAKT.
PERFORM DISPLAY_ALV_MAKT.
CLEAR RS_SELFIELD.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. "user_command
Form DATA_RETRIEVAL_MAKT
FORM DATA_RETRIEVAL_MAKT USING TMATNR .
SELECT MATNR
MAKTX
MAKTG
UP TO 100 ROWS
FROM MAKT
INTO TABLE ITAB1
WHERE SPRAS = 'EN' AND MATNR = TMATNR.
LOOP AT ITAB1.
data id_color type i VALUE 1.
data id_colors(2) type c.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab1-color.
modify itab1.
CLEAR ITAB1.
ENDLOOP.
ENDFORM. "DATA_RETRIEVAL_MAKT
Form FILLLAYOUT_MAKT
FORM FILLLAYOUT_MAKT .
CLEAR I_LAYOUT.
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
ENDFORM. " LAYOUT_MAKT
Form BUILD_FIELDCATLOG_MAKT
FORM BUILD_FIELDCATLOG_MAKT .
REFRESH FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
WA_FIELDCAT-EMPHASIZE = 'C510'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTX'.
WA_FIELDCAT-COL_POS = '2'.
WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTG'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-EMPHASIZE = 'C210'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. " BUILD_FIELDCATLOG_MAKT
Form DISPLAY_ALV_MAKT
FORM TOP-OF-PAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB1 lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "TOP-OF-PAGE
*& Form DISPLAY_ALV_MAKT
text
FORM DISPLAY_ALV_MAKT .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = I_TITLE_MAKT
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV_MAKT
Regards
Ashok kumar
Maybe you are looking for
-
the problem is when i was printed the cheque, the cheque no i entered manually is not to be updated, and also i checked the house of bank of accounts, in this next cheque no is entered here. i used to delete the mext cheque no and update.. but now a
-
Maximum number of Lock Entries
Hi Guys, I'm doing some WBS Settlements through CJ88/CJB1 . It might happen that this Txn may process thousands of WBS Elements at a time which means all those WBS Elements will be locked . How to find out the maximum Lock entries in SAP ? I want to
-
ITunes Connect : "There was a problem processing your upload"
Hello. Anyone got this message while uploading your application? I got that once and then I tried right away to upload my app, and it succeeded. My upload was only about 8-9MB. Anyone else experienced this or your app uploaded just fine the first tim
-
Hi, I'm a new mac user. I try to install boot camp with Windows XP but I only have the cd which is OEM from my old Dell. Would it work? Someone please help. Thanks.
-
Moving clouds in the sky... the good one.
Hi, i've search a lot, but no one has the closest match to what i am looking for. I've seen this on several sites even before version 8 was released. but is there anyone who ever knew how to move a cloud in a sky background as seemless? i knew the cl