Header line problem inside BADI method
Hi all,
I have to use a function CLAF_CLASSIFICTION_OF_OBJECTS'
inside a BADI called BATCH_Master.
Now the thing is that the data which I have to read gets fetched in one of the tables of function module.
Following CODE works fine if <b>I am not using BADI.</b>
Data: P_CLASS like SCLASS occurs 0 with header line,
P_OBJECTDATA like CLOBJDAT occurs 0 with header line.
Call Function 'CLaff_Classification_OF OBjects'
TABLES
T_CLASS = P_Class
T_OBJECTDATA = P_OBJECTDATA.
LOOP AT P_OBJECTDATA.
WRITE: / P_OBJECTDATA-AUSP1.
ENDLOOP.
<b>But if I am use BADI then I can't use header line.</b>
Data:
P_Class TYPE STANDARD TABLE OF SCLASS initial size 0,
P_Objectdata TYPE STANDARD TABLE OF CLOBJDAT initial size 0.
Now I can't print the values of P_Objectdata because I am not using header line since I am using BADI.
How can I print P_Objectdata because I can't use header line in BADI while declaring any table (Due to OO Concept) ?
> Hi all,
> I have to use a function
> CLAF_CLASSIFICTION_OF_OBJECTS'
> inside a BADI called BATCH_Master.
> Now the thing is that the data which I have to read
> gets fetched in one of the tables of function
> module.
>
> Following CODE works fine if <b>I am not using
> BADI.</b>
>
> Data: P_CLASS like SCLASS occurs 0 with header line,
> P_OBJECTDATA like CLOBJDAT occurs 0 with header
> line.
>
> *
> *
> Call Function 'CLaff_Classification_OF OBjects'
> *
> *
> TABLES
> T_CLASS = P_Class
> T_OBJECTDATA = P_OBJECTDATA.
> *
> *
>
> LOOP AT P_OBJECTDATA.
> WRITE: / P_OBJECTDATA-AUSP1.
> ENDLOOP.
>
> <b>But if I am use BADI then I can't use header
> line.</b>
> Data:
> P_Class TYPE STANDARD TABLE OF SCLASS initial size 0,
>
> P_Objectdata TYPE STANDARD TABLE OF CLOBJDAT initial
> size 0.
>
> Now I can't print the values of P_Objectdata because
> I am not using header line since I am using BADI.
>
> How can I print P_Objectdata because I can't use
> header line in BADI while declaring any table (Due to
> OO Concept) ?
If you declare your table without header line, make sure that the internal table is passed to a function call with the brackets
Call Function 'CLaff_Classification_OF OBjects'
TABLES
T_OBJECTDATA = itab[].
>
Also you need a workarea for your loop.
loop at itab into wa.
endloop.
Hope this helps
Christian
Similar Messages
-
Static lines problem and bad response from Apple employee
I first saw the static lines in my iphone5's keyboard and then again while opening a folder. It was only after 3 days from my purchase. The very next day I went to the Apple store of Shibuya (JAPAN) with my Japanese friend and talked the problem with Apple's employee but the response was really cold(rude, not like that of Apple store employee) Without listening to the whole thing he asked us to consult with Apple's technician in 2nd floor if we have any hardware issues and then leaved us without a single more word. It felt like an insult and then we returned back home with some bad images of Apple's employee in our mind. That was not our first visit there but definitely was first to get such a rude response.
Today once again I saw the same problem in my iPhone5. I am not sure if they will take my problem seriously or not if I visit there again. There in Silicon valley, Tim cook talks about the best customer experience in Apple store, but here in Japan we had a worst customer experience.
Tim, better provide normal customer service first than only talking about best customer experience.ok... just an FYI, this is a user to user forum... therefore no one from Apple will ever see your complaint. You can file your complaint at www.apple.com/feedback. In the situation with your phone, you can also contact your carrier and see if they will swap the device for you. In the USA I have Sprint, and had a similar issue when the 4S was released. Apple claimed they had no fix for it. Then I went to Sprint, and they swapped the phone for me and the issue was resolved. I haven't read anything about this issue with the 5 though.
-
Is ABAP Objects support Header Lines?
Hello Friends,
Is ABAP Objects (Object Oriented) Supports Header Lines? If not, why Abap Objects doesn't Support?
Thanks & Regards
Sathish KumarHi,
ABAP objects does not support HEADER LINE. you will get syntax error if your use OCCURS or WITH HEADER LINE in any class methods.
ABAP objects concept was brought to proivde strict type checkings. ABAP objects is a relatively new concept. even in normal ABAP program HEADER LINE is obsolete.
Use of tables with header line might lead to some coding error specially when maintaining.
If you use CLEAR itab, it clears the work area may be you intend to clear the table.
to clear the table you have to use CLEAR itab[]. This syntax is not advised and error prone so it is not allowed in ABAP objects. Its allowed in ABAP to be consistant with old programs which still use header line.
Regards,
Sesh
Message was edited by:
Seshatalpasai Madala -
MB_MIGO_BADI - Line item data inside CHECK_ITEMS method
Hi All,
I have implement MB_MIGO_BADI and i want to put a check inside the method CHECK_ITEMS where the importing parameter is line ID.
How can I get the data for the line based on the line ID inside the check_items methods, so that I can make the custom checks inside the method and populate the error message.
Please let me know how can we access the line item data inside the method CHECK_ITEMS.
Thanks and Regards,
VijayHi,
My requirement is to use BADI MB_MIGO_ITEM_BADI and restrict the creation of GR of items which have delivery date > PO Delivery date.
exact requirement is:-
Invoke Badi MB_MIGO_ITEM_BADI
Only for GR
Check EKKO-BSART =PJ where EKKO-BELNR = MSEG-EBELN
Check if the Po Line item has single or multiple delivery
a) If single
Check if MKPF-CPUDT-3 > EKPO-EEIND
Yes u2013 Create GR
No --- Give error message
b) Multiple Delivery
Check if EKET WEMNG =0
Select EKET-EINDT where EKET-WEMNG < EKET MENGE
Check EKET-EINDT < MKPF-CPUDT-3
Yes u2013 Create GR
No --- Give error message
Error Message : u201CGR Cannot be posted as Delivery date is in future u201C
Thanks
Vivek -
BADI cant use an internal table with header line
hi,
In BADI, we cant use an internal table with header line, and I am calling a function module which requires internal table as import parameter, now, the table I am passing is without a header line, So how to solve this problem ?You can use a type and then create an internal table of that type.
types :
begin of t_<example>
*field list
end of t_<example>
data :
gt_<table> type standard table of t_<example>
pass this to the FM -
Reg : BDC issue while updating infotype 40 inside BADI class method
Hi Friends,
Actually in my badi class, there is a method where i need to save the infotype fields including comment fields.. So with BDC recording i recorded screen fields and passing the pernr internal table values to recorded pernr values.. by doing this im getting error and so BDC is not upadting the data.. moreover if i pass directly pernr number within single quotes, BDC is working fine and data is getting updated..
bdc_field 'RP50G-PERNR' pernr. --> Error Message while calling transaction through BDC
bdc_field 'RP50G-PERNR' '00001234' ---> updating successfully..
1. Tell me whether the issue is with BADI or wat ? means we cant able to use BDC inside badi ?
2. I also tried changing my internal table value of pernr to type 'C' of length 8.. eventhough its showing error..
Please tell me what i need to do .... ?Hi Dilek Ersoz Adak ,
I also tried with that, but getting same error.. Below is my error im getting while updating BDC through call transaction,
1 PA30 SAPMP50A 1000 E K PBAS_SERVICE 001 HRADMIN EPPRELE 00000121 HRAdministrator CTU RP50G-PERNR
Person is treated already by the HR Administrator -
Having header line in the structure inside another structure
How can I have a header line in a structure within a structure?
(I have posted a question before...but seems to be unclear..so I closed that thread and open a new one)
Thanks!
When compiling the below codes, I got error message stating that 'The internal table "IT_SALES_ORDER-DETAIL" has no header line - explicit specification of an output area with "INTO wa" or "ASSIGNING <fs>" is required'.
I know that the problem can be solved by using field symbols... but I wonder I can have a header line declared in a structure within another structure.
types: begin of ty_header,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
audat like vbak-audat,
vkorg like vbak-vkorg,
vtweg like vbak-vtweg,
spart like vbak-spart,
kunnr like vbak-kunnr,
netwr like vbak-netwr,
end of ty_header.
types: begin of ty_detail,
posnr like vbep-posnr,
edatu like vbep-edatu,
etenr like vbep-etenr,
ettyp like vbep-ettyp,
wmeng like vbep-wmeng,
bmeng like vbep-bmeng,
vrkme like vbep-vrkme,
mbdat like vbep-mbdat,
lddat like vbep-lddat,
end of ty_detail.
types: begin of ty_sales_order,
header type ty_header,
detail type ty_detail occurs 0,
end of ty_sales_order.
data: it_sales_order type standard table of ty_sales_order
with header line initial size 0.
data: it_selected_order type standard table of ty_header
with header line initial size 0.
select *
into corresponding fields of table it_selected_order
from vbak
where erdat > '01.01.2005' and erdat < '31.12.2005'.
write :/ sy-subrc.
loop at it_selected_order.
clear: it_sales_order-header, it_sales_order-detail.
move-corresponding it_selected_order to it_sales_order-header.
select *
into corresponding fields of table it_sales_order-detail
from vbep
where vbeln = it_sales_order-header-vbeln.
append it_sales_order.
endloop.
loop at it_sales_order.
write :/ it_sales_order-header-vbeln.
loop at it_sales_order-detail.
endloop.
endloop.You have to use a work area here, no header lines.
report zrich_0002 no standard page heading.
types: begin of ty_header,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
audat like vbak-audat,
vkorg like vbak-vkorg,
vtweg like vbak-vtweg,
spart like vbak-spart,
kunnr like vbak-kunnr,
netwr like vbak-netwr,
end of ty_header.
types: begin of ty_detail,
posnr like vbep-posnr,
edatu like vbep-edatu,
etenr like vbep-etenr,
ettyp like vbep-ettyp,
wmeng like vbep-wmeng,
bmeng like vbep-bmeng,
vrkme like vbep-vrkme,
mbdat like vbep-mbdat,
lddat like vbep-lddat,
end of ty_detail.
types: begin of ty_sales_order,
header type ty_header,
detail type ty_detail occurs 0,
end of ty_sales_order.
data: it_sales_order type standard table of ty_sales_order
with header line initial size 0.
data: it_selected_order type standard table of ty_header
with header line initial size 0.
<b>data: wa_detail type ty_detail.</b>
select *
into corresponding fields of table it_selected_order
from vbak
where erdat > '01.01.2005' and erdat < '31.12.2005'.
write :/ sy-subrc.
loop at it_selected_order.
clear: it_sales_order-header, it_sales_order-detail.
move-corresponding it_selected_order to it_sales_order-header.
select *
into corresponding fields of table it_sales_order-detail
from vbep
where vbeln = it_sales_order-header-vbeln.
append it_sales_order.
endloop.
loop at it_sales_order.
write :/ it_sales_order-header-vbeln.
<b> loop at it_sales_order-detail into wa_detail.</b>
endloop.
endloop.
Regards,
Rich Heilman
Message was edited by: Rich Heilman -
Call of a BADI method inside another BADI
Dear colleagues,
Could someone guide me with the information whether it is allowed to create/call a Badi inside an implementation of another Badi method?
Please let me know whether there are other alternatives or the Badi call within Badi acceptable as per SAP standards?
Many thanks in advance,
Best regards,
Srivatsahi Ganesh,
Check this out
<b>Calling a BADI from another BADI</b>
Regards,
Santosh -
Syntax error while using the parameter inside the badi method.
Hello all ,
I'm writing a code in the badi implementation . The badi is /SAPSLL/CTRL_MM0C_R3 . this badi contains a metthod API_CONTROL_MODIFY.This badi triggers while using MIGO transaction .
It is having the following parameter .
IT_MSEG Importing Type SLLR3_MSEG_T .
SLLR3_MSEG_T is declared as follows.
TYPES: sllr3_mkpf_t LIKE mkpf OCCURS 0,
sllr3_mseg_t LIKE mseg OCCURS 0.
here i have to get the werks value that is populated into IT_MSEG whie doing MIGO .
I have declared a local variable and assigned werks value from the IT_MSEG to the local variable as follows
DATA:l_werks type werks.
l_werks = IT_MSEG-WERKS.
But I'm getting the following error.
"IT_MSEG" is a table without a header line and therefore has no
component called "WERKS".
How should i avoid this error. Please give me sample code on how to avoid this error.
thanks in advance
pavanHi,
Move the row from IT_MSEG into a work area and use it. Declare the workarea of required type.
DATA:l_werks type werks.
read table it_mseg into wa_mseg index 1.
l_werks = wa_MSEG-WERKS.
Regards
Vinod -
Hi Experts/Gurus,
I had a problem when i am passing the ct_extension data to ct_text. I need to pass the data of two new fields created in order jsp as extension data. For this i used the BADI method "changehead_before_order" and i had passed this extensoin data from ct_extension to ct_text which can be passed to crm_order_maintain before order. And when i try to get the data using the method gethead_get_data, in this iam calling CRM_ORDER_READ to get the values of IT_TEXT, the b2b webshop is giving an error and asking to logon again.
The below is the code which i have written in both the methods:
METHOD if_ex_crm_isa_basket_head~changehead_before_order.
DATA : ls_orderadm_h TYPE LINE OF crmt_orderadm_h_comt,
wa_orderadm_h TYPE LINE OF crmt_orderadm_h_comt,
ls_extension TYPE crmt_isales_extension,
wa_extension TYPE crmt_isales_extension,
ls_text TYPE crmt_text_comt,
ls_lines TYPE comt_text_lines_t,
wa_lines LIKE LINE OF ls_lines,
wa_text LIKE LINE OF ls_text,
READ TABLE it_extension INTO wa_extension WITH KEY name = 'ZEXTNSM'.
wa_text-ref_guid = wa_extension-ref_guid.
* wa_text-tdobject = 'CRM_ORDERH'.
* wa_text-tdname = wa_extension-ref_guid.
wa_text-tdid = '0001'.
wa_lines-tdline = wa_extension-value.
APPEND wa_lines TO ls_lines.
wa_text-lines = ls_lines.
INSERT wa_text INTO TABLE ct_text.
CLEAR wa_text.
CLEAR wa_lines.
CLEAR ls_lines.
READ TABLE it_extension INTO wa_extension WITH KEY name = 'ZEXTNSI'.
wa_text-ref_guid = wa_extension-ref_guid.
wa_text-tdid = '0002'.
wa_lines-tdline = wa_extension-value.
APPEND wa_lines TO ls_lines.
wa_text-lines = ls_lines.
INSERT wa_text INTO TABLE ct_text.
* ct_text = ls_text.
* append ls_text to CT_TEXT.
ENDMETHOD.
to get the data :
METHOD if_ex_crm_isa_basket_head~gethead_get_data.
DATA : ls_extension TYPE crmt_isales_extension,
ls_text TYPE crmt_text_comt,
wa_text type CRMT_TEXT_COM,
ls_lines TYPE comt_text_lines_t ,
wa_lines type TLINE,
ls_basket_head TYPE crmt_isales_baskethead_ui,
lv_objectid type CRMT_OBJECT_ID.
lv_objectid = cs_basket_head-OBJECT_ID.
if lv_objectid is not initial.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = cs_basket_head-guid
IMPORTING
et_text = ls_text.
READ TABLE ls_text INTO wa_text WITH KEY tdid = 'ZSM'.
*Appending the discount value from the database.
ls_extension-ref_guid = cs_basket_head-guid.
ls_extension-name = 'ZEXTNSM'.
ls_lines[] = wa_text-lines[].
READ TABLE ls_lines INTO wa_lines INDEX 0.
ls_extension-value = wa_lines-TDLINE.
APPEND ls_extension TO ct_extension.
CLEAR ls_extension.
endif.
ENDMETHOD.
When i put the external break point and checked, in the webshop when i click the update button, in the method changehead_before_order, in the ct_extension table i am getting the values and keys which i have set in the java action. But when i click "order" button, i am not getting anything in ct_extension table which i cannot in turn pass this values to ct_text.
Can you please help me in this regard??
Thanks a lot in Advance!
Regards,
Lakshman.The header guid i am trying to pass to the crm_order_read is a mismatch.
-
SUBMIT inside a method & the automation queue
Hi,
I call a method via a tree toolbar button in that calls a standard SAP report using the SUBMIT AND RETURN command. This is done within a screen with several docking containers and split screens attached.
The problem is that when I press the toolbar button, the report (which also has docking container) is presented partially inside my screen.
When I put a BREAK-POINT on the SUBMIT statement it is good and I can see SAP's report with no issues and I do not see my screen. When I take the break point off it is back to the original problem.
This leaves me to think that it is an automation queue problem or something like that.
How can I get over this?
Thanks,
ItayHello Itay
I tried to simulate your situation. Perhaps you get from this sample report (which was copied from BCALV_TREE_DEMO and the adjusted) some ideas how to solve your problem. In my report all controls are displayed properly.
[code]&----
*& Report ZUS_SDN_BCALV_TREE_DEMO_8 *
*& Based on: BCALV_TREE_DEMO *
REPORT zus_sdn_bcalv_tree_demo.
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_left TYPE REF TO cl_gui_container,
go_cell_right TYPE REF TO cl_gui_container,
go_grid TYPE REF TO cl_gui_alv_grid.
data:
gt_knb1 type standard table of knb1. " dummy
*$Comment: begin
DATA:
gd_delete_nkey TYPE lvc_nkey.
*$Comment: end
CLASS cl_gui_column_tree DEFINITION LOAD.
CLASS cl_gui_cfw DEFINITION LOAD.
DATA tree1 TYPE REF TO cl_gui_alv_tree.
DATA mr_toolbar TYPE REF TO cl_gui_toolbar.
INCLUDE <icon>.
INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.
*INCLUDE zus_sdn_bcalv_tb_event_rcvr.
*include bcalv_toolbar_event_receiver.
INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.
*INCLUDE zus_sdn_bcalv_tree_event_rcvr.
*include bcalv_tree_event_receiver.
DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
DATA: gt_sflight TYPE sflight OCCURS 0, "Output-Table
gt_fieldcatalog TYPE lvc_t_fcat, "Fieldcatalog
ok_code LIKE sy-ucomm. "OK-Code
START-OF-SELECTION.
Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 1
columns = 2
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_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.
Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_left.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = go_cell_right.
Create ALV grid
CREATE OBJECT go_grid
EXPORTING
i_parent = go_cell_right
EXCEPTIONS
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.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
CHANGING
it_outtab = gt_knb1
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 100.
END-OF-SELECTION.
*& Module PBO OUTPUT
process before output
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
IF tree1 IS INITIAL.
PERFORM init_tree.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PBO OUTPUT
*& Module PAI INPUT
process after input
MODULE pai INPUT.
translate ok_code to upper case.
CASE ok_code.
WHEN 'EXIT' OR 'BACK' OR 'CANC'.
PERFORM exit_program.
*$Comment: begin
WHEN 'DELETE'.
CALL METHOD tree1->delete_subtree
EXPORTING
i_node_key = gd_delete_nkey " = folder 'AA'
I_UPDATE_PARENTS_EXPANDER = SPACE
I_UPDATE_PARENTS_FOLDER = SPACE
EXCEPTIONS
node_key_not_in_model = 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.
CALL METHOD tree1->update_calculations
EXPORTING
no_frontend_update = ' '. " do frontend update
*$Comment: end
WHEN OTHERS.
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
CLEAR ok_code.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PAI INPUT
*& Form build_fieldcatalog
build fieldcatalog for structure sflight
FORM build_fieldcatalog.
get fieldcatalog
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = gt_fieldcatalog.
SORT gt_fieldcatalog BY scrtext_l.
change fieldcatalog
DATA: ls_fieldcatalog TYPE lvc_s_fcat.
LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
CASE ls_fieldcatalog-fieldname.
WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
ls_fieldcatalog-no_out = 'X'.
ls_fieldcatalog-key = ''.
WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
ls_fieldcatalog-do_sum = 'X'.
ENDCASE.
MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
ENDLOOP.
ENDFORM. " build_fieldcatalog
*& Form build_hierarchy_header
build hierarchy-header-information
-->P_L_HIERARCHY_HEADER strucxture for hierarchy-header
FORM build_hierarchy_header CHANGING
p_hierarchy_header TYPE treev_hhdr.
p_hierarchy_header-heading = 'Hierarchy Header'. "#EC NOTEXT
p_hierarchy_header-tooltip =
'This is the Hierarchy Header !'. "#EC NOTEXT
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ''.
ENDFORM. " build_hierarchy_header
*& Form exit_program
free object and leave program
FORM exit_program.
CALL METHOD tree1->free.
LEAVE PROGRAM.
ENDFORM. " exit_program
*& Form build_header
build table for html_header
--> p1 text
<-- p2 text
FORM build_comment USING
pt_list_commentary TYPE slis_t_listheader
p_logo TYPE sdydo_value.
DATA: ls_line TYPE slis_listheader.
LIST HEADING LINE: TYPE H
CLEAR ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'ALV-tree-demo: flight-overview'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
STATUS LINE: TYPE S
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-key = 'valid until'. "#EC NOTEXT
ls_line-info = 'January 29 1999'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
ls_line-key = 'time'.
ls_line-info = '2.00 pm'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
ACTION LINE: TYPE A
CLEAR ls_line.
ls_line-typ = 'A'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'actual data'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
p_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "build_comment
*& Form create_hierarchy
text
--> p1 text
<-- p2 text
FORM create_hierarchy.
DATA: ls_sflight TYPE sflight,
lt_sflight TYPE sflight OCCURS 0.
get data
SELECT * FROM sflight INTO TABLE lt_sflight
UP TO 200 ROWS . "#EC CI_NOWHERE
SORT lt_sflight BY carrid connid fldate.
add data to tree
DATA: l_carrid_key TYPE lvc_nkey,
l_connid_key TYPE lvc_nkey,
l_last_key TYPE lvc_nkey.
LOOP AT lt_sflight INTO ls_sflight.
ON CHANGE OF ls_sflight-carrid.
PERFORM add_carrid_line USING ls_sflight
CHANGING l_carrid_key.
ENDON.
*$Comment: begin
IF ( ls_sflight-carrid = 'AA' ).
gd_delete_nkey = l_carrid_key.
ENDIF.
*$Comment: end
ON CHANGE OF ls_sflight-connid.
PERFORM add_connid_line USING ls_sflight
l_carrid_key
CHANGING l_connid_key.
ENDON.
PERFORM add_complete_line USING ls_sflight
l_connid_key
CHANGING l_last_key.
ENDLOOP.
calculate totals
CALL METHOD tree1->update_calculations.
this method must be called to send the data to the frontend
CALL METHOD tree1->frontend_update.
ENDFORM. " create_hierarchy
*& Form add_carrid_line
add hierarchy-level 1 to tree
-->P_LS_SFLIGHT sflight
-->P_RELEATKEY relatkey
<-->p_node_key new node-key
FORM add_carrid_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value,
ls_sflight TYPE sflight.
set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-t_image = '@3P@'.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-style =
cl_gui_column_tree=>style_intensifd_critical.
APPEND ls_item_layout TO lt_item_layout.
add node
l_node_text = ps_sflight-carrid.
DATA: ls_node TYPE lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
is_node_layout = ls_node
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_carrid_line
*& Form add_connid_line
add hierarchy-level 2 to tree
-->P_LS_SFLIGHT sflight
-->P_RELEATKEY relatkey
<-->p_node_key new node-key
FORM add_connid_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value,
ls_sflight TYPE sflight.
set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-t_image = '@3Y@'.
ls_item_layout-style =
cl_gui_column_tree=>style_intensified.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
APPEND ls_item_layout TO lt_item_layout.
add node
l_node_text = ps_sflight-connid.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_connid_line
*& Form add_cmplete_line
add hierarchy-level 3 to tree
-->P_LS_SFLIGHT sflight
-->P_RELEATKEY relatkey
<-->p_node_key new node-key
FORM add_complete_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value.
set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-class = cl_gui_column_tree=>item_class_checkbox.
ls_item_layout-editable = 'X'.
APPEND ls_item_layout TO lt_item_layout.
CLEAR ls_item_layout.
ls_item_layout-fieldname = 'PLANETYPE'.
ls_item_layout-alignment = cl_gui_column_tree=>align_right.
APPEND ls_item_layout TO lt_item_layout.
l_node_text = ps_sflight-fldate.
DATA: ls_node TYPE lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
is_outtab_line = ps_sflight
i_node_text = l_node_text
is_node_layout = ls_node
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_complete_line
*& Form register_events
text
--> p1 text
<-- p2 text
FORM register_events.
define the events which will be passed to the backend
DATA: lt_events TYPE cntl_simple_events,
l_event TYPE cntl_simple_event.
define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_click.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
APPEND l_event TO lt_events.
CALL METHOD tree1->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
set Handler
DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
CREATE OBJECT l_event_receiver.
SET HANDLER l_event_receiver->handle_node_ctmenu_request
FOR tree1.
SET HANDLER l_event_receiver->handle_node_ctmenu_selected
FOR tree1.
SET HANDLER l_event_receiver->handle_item_ctmenu_request
FOR tree1.
SET HANDLER l_event_receiver->handle_item_ctmenu_selected
FOR tree1.
ENDFORM. " register_events
*& Form change_toolbar
text
--> p1 text
<-- p2 text
FORM change_toolbar.
get toolbar control
CALL METHOD tree1->get_toolbar_object
IMPORTING
er_toolbar = mr_toolbar.
CHECK NOT mr_toolbar IS INITIAL.
add seperator to toolbar
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = ''
icon = ''
butn_type = cntb_btype_sep
text = ''
quickinfo = 'This is a Seperator'. "#EC NOTEXT
add Standard Button to toolbar (for Delete Subtree)
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = 'DELETE'
icon = '@18@'
butn_type = cntb_btype_button
text = ''
quickinfo = 'Delete subtree'. "#EC NOTEXT
add Dropdown Button to toolbar (for Insert Line)
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = 'INSERT_LC'
icon = '@17@'
butn_type = cntb_btype_dropdown
text = ''
quickinfo = 'Insert Line'. "#EC NOTEXT
Add SUBMIT-Button
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = 'SUBMIT'
icon = '@15@'
butn_type = cntb_btype_button
text = ''
quickinfo = 'SUBMIT report'. "#EC NOTEXT
set event-handler for toolbar-control
CREATE OBJECT toolbar_event_receiver.
SET HANDLER toolbar_event_receiver->on_function_selected
FOR mr_toolbar.
SET HANDLER toolbar_event_receiver->on_toolbar_dropdown
FOR mr_toolbar.
ENDFORM. " change_toolbar
*& Form init_tree
text
--> p1 text
<-- p2 text
FORM init_tree.
create fieldcatalog for structure sflight
PERFORM build_fieldcatalog.
create container for alv-tree
DATA: l_tree_container_name(30) TYPE c,
l_custom_container TYPE REF TO cl_gui_custom_container.
l_tree_container_name = 'TREE1'.
IF sy-batch IS INITIAL.
CREATE OBJECT l_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC
*NOTEXT
ENDIF.
ENDIF.
create tree control
CREATE OBJECT tree1
EXPORTING
parent = go_cell_left
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = ''
no_toolbar = ''
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
create Hierarchy-header
DATA l_hierarchy_header TYPE treev_hhdr.
PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
create info-table for html-header
DATA: lt_list_commentary TYPE slis_t_listheader,
l_logo TYPE sdydo_value.
PERFORM build_comment USING
lt_list_commentary
l_logo.
repid for saving variants
DATA: ls_variant TYPE disvariant.
ls_variant-report = sy-repid.
create emty tree-control
CALL METHOD tree1->set_table_for_first_display
EXPORTING
is_hierarchy_header = l_hierarchy_header
it_list_commentary = lt_list_commentary
i_logo = l_logo
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = ls_variant
CHANGING
it_outtab = gt_sflight "table must be emty !!
it_fieldcatalog = gt_fieldcatalog.
create hierarchy
PERFORM create_hierarchy.
add own functioncodes to the toolbar
PERFORM change_toolbar.
register events
PERFORM register_events.
adjust column_width
call method tree1->COLUMN_OPTIMIZE.
ENDFORM. " init_tree[/code]
<b>INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.</b>
[code]----
INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8 *
CLASS lcl_toolbar_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS: on_function_selected
FOR EVENT function_selected OF cl_gui_toolbar
IMPORTING fcode,
on_toolbar_dropdown
FOR EVENT dropdown_clicked OF cl_gui_toolbar
IMPORTING fcode
posx
posy.
ENDCLASS. "lcl_toolbar_event_receiver DEFINITION
CLASS lcl_toolbar_event_receiver IMPLEMENTATION
CLASS lcl_toolbar_event_receiver IMPLEMENTATION.
METHOD on_function_selected.
DATA: ls_sflight TYPE sflight.
CASE fcode.
WHEN 'SUBMIT'.
SUBMIT zus_sdn_two_alv_grids AND RETURN.
WHEN 'DELETE'.
get selected node
DATA: lt_selected_node TYPE lvc_t_nkey.
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
DATA l_selected_node TYPE lvc_nkey.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
delete subtree
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->delete_subtree
EXPORTING
i_node_key = l_selected_node
i_update_parents_expander = ''
i_update_parents_folder = 'X'.
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_LC'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship = cl_tree_control_base=>relat_last_child
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Last Child'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_FC'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship = cl_tree_control_base=>relat_first_child
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'First Child'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_FS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_first_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'First Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_LS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_last_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Last Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_NS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_next_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Next Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
ENDCASE.
update frontend
CALL METHOD tree1->frontend_update.
ENDMETHOD. "on_function_selected
METHOD on_toolbar_dropdown.
create contextmenu
DATA: l_menu TYPE REF TO cl_ctmenu,
l_fc_handled TYPE as4flag.
CREATE OBJECT l_menu.
CLEAR l_fc_handled.
CASE fcode.
WHEN 'INSERT_LC'.
l_fc_handled = 'X'.
insert as last child
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_LC'
text = 'Insert New Line as Last Child'. "#EC NOTEXT
insert as first child
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_FC'
text = 'Insert New Line as First Child'. "#EC NOTEXT
insert as next sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_NS'
text = 'Insert New Line as Next Sibling'. "#EC NOTEXT
insert as last sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_LS'
text = 'Insert New Line as Last Sibling'. "#EC NOTEXT
insert as first sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_FS'
text = 'Insert New Line as First Sibling'. "#EC NOTEXT
ENDCASE.
show dropdownbox
IF l_fc_handled = 'X'.
CALL METHOD mr_toolbar->track_context_menu
EXPORTING
context_menu = l_menu
posx = posx
posy = posy.
ENDIF.
ENDMETHOD. "on_toolbar_dropdown
ENDCLASS. "lcl_toolbar_event_receiver IMPLEMENTATION[/code]
<b>INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.</b>
[code]----
INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8 *
class lcl_tree_event_receiver definition.
public section.
methods handle_node_ctmenu_request
for event node_context_menu_request of cl_gui_alv_tree
importing node_key
menu.
methods handle_node_ctmenu_selected
for event node_context_menu_selected of cl_gui_alv_tree
importing node_key
fcode.
methods handle_item_ctmenu_request
for event item_context_menu_request of cl_gui_alv_tree
importing node_key
fieldname
menu.
methods handle_item_ctmenu_selected
for event item_context_menu_selected of cl_gui_alv_tree
importing node_key
fieldname
fcode.
methods handle_item_double_click
for event item_double_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_button_click
for event button_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_link_click
for event link_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_header_click
for event header_click of cl_gui_alv_tree
importing fieldname.
endclass.
class lcl_tree_event_receiver implementation.
method handle_node_ctmenu_request.
append own functions
call method menu->add_function
exporting fcode = 'USER1'
text = 'Usercmd 1'. "#EC NOTEXT
call method menu->add_function
exporting fcode = 'USER2'
text = 'Usercmd 2'. "#EC NOTEXT
call method menu->add_function
exporting fcode = 'USER3'
text = 'Usercmd 3'. "#EC NOTEXT
endmethod.
method handle_node_ctmenu_selected.
case fcode.
when 'USER1' or 'USER2' or 'USER3'.
message i000(0h) with 'Node-Context-Menu on Node ' node_key
'fcode : ' fcode. "#EC NOTEXT
endcase.
endmethod.
method handle_item_ctmenu_request .
append own functions
call method menu->add_function
exporting fcode = 'USER1'
text = 'Usercmd 1'.
call method menu->add_function
exporting fcode = 'USER2'
text = 'Usercmd 2'.
call method menu->add_function
exporting fcode = 'USER3'
text = 'Usercmd 3'.
endmethod. -
Passing an internal table WITH HEADER LINE to abap object
Hi. In another thread, it was explained how to pass an internal table to an abap object method. Is it possible to pass an internal table that has a header line, and RETAIN the header line once the table has been passed?
My problem is, that I can pass the table, update it, but the read buffer is not populated when returning from the object's method. This is the result of being able to pass a STANDARD TABLE type, but not a STANDARD TABLE WITH HEADER LINE.
This means that I have to read the table into a work area instead of doing a READ TABLE LKNA1 within the method, which is what I need to do.
Thanks.Please check this sample program, notice that it is modifing the internal table and passing it back modified as well as passing the "work area" or "header line" back thru the exporting parameter.
report zrich_0001.
* CLASS lcl_app DEFINITION
class lcl_app definition.
public section.
types: t_t001 type table of t001.
class-data: it001 type table of t001.
class-data: xt001 like line of it001.
class-methods: change_table
exporting ex_wt001 type t001
changing im_t001 type t_t001.
endclass.
data: w_t001 type t001.
data: a_t001 type table of t001 with header line.
start-of-selection.
select * into table a_t001 from t001.
call method lcl_app=>change_table
importing
ex_wt001 = w_t001
changing
im_t001 = a_t001[] .
check sy-subrc = 0.
* CLASS lcl_app IMPLEMENTATION
class lcl_app implementation.
method change_table.
loop at im_t001 into xt001.
concatenate xt001-butxt 'Changed'
into xt001-butxt separated by space.
modify im_t001 from xt001.
endloop.
ex_wt001 = xt001.
endmethod.
endclass.
Regards,
Rich Heilman -
Alv - how to create a broader header line?
I'm using the 'TOP_OF_PAGE' parameter within 'AVL_GRID_DISPLAY' FM in connection with 'REUSE_ALV_COMMENTARY_WRITE' to create a Header Line for the List-display.
My Problem is, that I really need to get a broader header with approx. 120 characters but the only structure, 'REUSE_ALV_COMMENTARY_WRITE' seems to allow is 'slis_listheader' which is only three fields broad with 80 characters.
I need a line with 6 fields and 120 to 150 characters - how can i possibly submit that to the function module, or somehow different to 'TOP_OF_PAGE'...?
Thanks, ClemensClemens
I think you will have to format the header yourself.
The problem is that you need to have a pointer to the document (cl_dd_document class) so you can modify it as you want. The only way I found is to use I_CALLBACK_HTML_TOP_OF_PAGE parameter when you call REUSE_ALV_GRID_DISPLAY.
Unortunately, the form specified in I_CALLBACK_TOP_OF_PAGE parameter for REUSE_ALV_GRID_DISPLAY FM is not being called with any parameters. Therefore can't be used to create your heading.
Now, you need to call your FM like this:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_HTML_TOP_OF_PAGE = 'TOP_OF_PAGE1'
...other parameters....
then you will need to create that FORM:
FORM TOP_OF_PAGE1 USING p_doc type ref to cl_dd_document.
DATA: mytoptext(255) TYPE C.
CONCATENATE 'This is my very long text. Probably about 140 chars long'
'or more just to check if it all appears as is. Hopefully with a bit'
'of luck we might have some success here.'
into mytoptext separated by space.
CALL METHOD p_doc->new_line.
CALL METHOD p_doc->add_text
EXPORTING text = mytoptext.
ENDFORM.
I advise that you have a look on the original SAP FM (REUSE_ALV_GRID_COMMENTARY_SET), which is used to format your commentary (through memorised parameter DYNDOS_FOR_ALV) and based on that you can make your heading.
If you can't use I_CALLBACK_HTML_TOP_OF_PAGE parameter then probably defining your own grid is a solution (a bit longer to implement, though).
Hope this helps.
Wojtek -
Chunked header line gets removed
Some webserver at akamai (for instance: www.fedex.com ) delivers the data chunked.
A snoop trace indicated that the server sends a header line "Transfer-Encoding: chunked". The proxy (3.6 SP6 on Solaris) removes this header as it sends it to the client. The content however still has all chunk sizes within. So, in the browser, we see the content with lots of 8-digit hex-numbers in between.
Is this a bug in 3.6 SP6?
Best regards,
Jeroen Besse> Hi all,
> I have to use a function
> CLAF_CLASSIFICTION_OF_OBJECTS'
> inside a BADI called BATCH_Master.
> Now the thing is that the data which I have to read
> gets fetched in one of the tables of function
> module.
>
> Following CODE works fine if <b>I am not using
> BADI.</b>
>
> Data: P_CLASS like SCLASS occurs 0 with header line,
> P_OBJECTDATA like CLOBJDAT occurs 0 with header
> line.
>
> *
> *
> Call Function 'CLaff_Classification_OF OBjects'
> *
> *
> TABLES
> T_CLASS = P_Class
> T_OBJECTDATA = P_OBJECTDATA.
> *
> *
>
> LOOP AT P_OBJECTDATA.
> WRITE: / P_OBJECTDATA-AUSP1.
> ENDLOOP.
>
> <b>But if I am use BADI then I can't use header
> line.</b>
> Data:
> P_Class TYPE STANDARD TABLE OF SCLASS initial size 0,
>
> P_Objectdata TYPE STANDARD TABLE OF CLOBJDAT initial
> size 0.
>
> Now I can't print the values of P_Objectdata because
> I am not using header line since I am using BADI.
>
> How can I print P_Objectdata because I can't use
> header line in BADI while declaring any table (Due to
> OO Concept) ?
If you declare your table without header line, make sure that the internal table is passed to a function call with the brackets
Call Function 'CLaff_Classification_OF OBjects'
TABLES
T_OBJECTDATA = itab[].
>
Also you need a workarea for your loop.
loop at itab into wa.
endloop.
Hope this helps
Christian -
Add new email header line and add Bcc recepient to this additional header.
Hi Folks,
iMS5.2p1, Solaris 8.
Just after a few directions. I have a 'catch-all' mbox, that customer POP's. The customer then uses MDaemon to deliver email, based on rules to correct recepients, works fine until a Bcc comes in, as quoted below.
Why doesn't MDaemon parse the BCC header?
BCC only works with SMTP mail. By definition, the carbon copy is "Blind".
There are no headers in the message which can be parsed using the POP3 method that would provide the address. The only hope for these kinds of messages is to get the ISP to stamp the message file with the delivery information from the SMTP session during delivery to the ISP. For example, when the person sends the BCC message to the ISP hosting the mail, some of them stamp a header called "Deliver-To:" into the message. MDaemon could pick up on such a header if it existed.
I know I would have to tackle this with either a re-write/mapping/conversion, but not sure what the best approach, ie to add and rewrite the Bcc, recepient into the new 'Deliver-To:' header.
Any good solutions/tips ?
Cheers folks.Hi Jay,
Sorry if there is any confusion. The customer at his premises has a server running this mail app. called MDaemon, which uses filters to deliver to local mboxes for their users. The customer in question just wanted a 'catch-all' mbox with iMS for his domain (which we host), to just POP3 this mbox and then the customer's MDaemon app, parses through filters to deliver to correct local mbox. They didn't want to have each user's mbox hosted on iMS....as yet anyway, thus the need for 'catch-all' delivery of email for the customer domain to one iMS mbox.
The problem is with any Bcc email for customer's domain. As described POP3 as per definition hides the Bcc line, thus MDeamon filters at customer end will fail delivery to intended recepient. Thus the doco from MDaemon as explained to me from the customer can handle additional header lines and parse that way. Thus the need to add the recepient in the Bcc line to an additional header (ie. Deliver-To: [Bcc smtp recepient]). Then as MDeamon doco says it can be setup to parse and deliver to correct local mbox. I hope that my be a little clearer.
So I need to on iMS rewrite any Bcc recepient for customers 'catch-all' mail domain and add another header line (ie. Deliver-To: [Bcc smtp recpient]). So when customer POP's iMS mbox, Mdeamon at customer's end will parse and deliver locally.
Hope that makes sense and the best way to add an additional header and take the original Bcc line and add to to new header is.....hopefully a pointer from your good self.
Cheers.
Maybe you are looking for
-
Want to upload company logo into ICON table
hi i want to upload my company logo into ICON table how i can upload it . thanks in advanced.
-
Add 'soft link' of a shared file in the body of message.
I want to know if there is a way to hyperlink a shared file which is on a server and add it in the body of message rather than sending that whole file as an attachment. So that when the recipeint receives the e-mail, he/she can just click on the link
-
Download problem from 'Z' table
Hi I am facing very strange problem , I have created a 'Z' table and now it has 2800 records but when i download from data base it only get the 1627 records What might me the problem ??? Technical Settings : Data class APPL0 Master data, t
-
How to re-install to refresh Symbian Belle FP2 150...
Hi! There used to be a re-install option in Nokia Suite... How to re-install on Nokia 808 PureView to refresh Symbian Belle FP2 1508 on Nokia PC Suite or Nokia Suite without reformatting? Just an in-place re-install will do, thanks! Attachments: NSU
-
Assign Business Area to Plant/Valuation Area and Division
Hi, While assigning Business Area to Plant/Valuation Area and Division, in SPRO we are getting two tabs for the same: a. Allocation for Plants and Valuation Areas differs. b. Allocation for Plants & valuation areas identical. What is the actual use o