Say I have a table with customers, which is shown in an alv-grid like so:
**BEFORE THIS: Set up parameters, SQL Select, Table etc.
CREATE OBJECT gr_alv_grid
EXPORTING
i_parent = cl_gui_custom_container=>default_screen
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
ENDIF.
gr_alv_grid->set_table_for_first_display(
EXPORTING
i_structure_name = 'ZDebcdstest'
CHANGING
it_outtab = lt_debis
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
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.
What I would like to have is the option to double-click on any given row and get a more detailed overview of the object contained therein, like for instance done in SE16. I have already set up an Event Handler to listen for a double click, which works, but I haven't figured out how to get all the relevant data in a row and display the chosen object in full detail.
Any help is greatly appreciated.
Here is the primitive sample how to make it work "like for instance done in SE16'
METHOD handle_double_click.
DATA: ls_sflight LIKE LINE OF gt_sflight,
ls_layout TYPE lvc_s_layo.
DATA: lt_fieldcatalog TYPE lvc_t_fcat,
ls_fieldcatalog TYPE lvc_s_fcat.
DATA: details_outtab TYPE lvc_t_detm,
ls_detail TYPE lvc_s_detm,
lt_detail_tab TYPE lvc_t_deta,
ls_detail_tab TYPE lvc_s_deta.
READ TABLE gt_sflight INDEX e_row-index INTO ls_sflight.
ls_fieldcatalog-fieldname = 'COLUMNTEXT'.
ls_fieldcatalog-ref_table = 'LVC_S_DETA'.
ls_fieldcatalog-key = 'X'.
ls_fieldcatalog-seltext = 'Field'.
ls_fieldcatalog-outputlen = 30.
APPEND ls_fieldcatalog TO lt_fieldcatalog.
CLEAR ls_fieldcatalog.
ls_fieldcatalog-fieldname = 'VALUE'.
ls_fieldcatalog-ref_table = 'LVC_S_DETA'.
ls_fieldcatalog-seltext = 'Field value'.
ls_fieldcatalog-outputlen = 20.
APPEND ls_fieldcatalog TO lt_fieldcatalog.
ls_layout-no_toolbar = 'X'.
LOOP AT gt_fieldcat ASSIGNING FIELD-SYMBOL(<field>).
ls_detail_tab-columntext = <field>-scrtext_l.
ASSIGN COMPONENT sy-tabix OF STRUCTURE ls_sflight TO FIELD-SYMBOL(<col>).
ls_detail_tab-value = <col>.
APPEND ls_detail_tab TO lt_detail_tab.
ENDLOOP.
ls_detail-detailtab = lt_detail_tab.
APPEND ls_detail TO details_outtab.
CALL FUNCTION 'LVC_ITEM_DETAIL'
EXPORTING
i_title = 'Row details'
it_fieldcatalog = lt_fieldcatalog
is_layout = ls_layout
TABLES
t_outtab = details_outtab.
ENDMETHOD. "handle_double_click
in the above snippet
gt_sflight - main table you wanna capture row details from
gt_fieldcat - field catalog of this table which must be populated before firing the event
if you don't know how apply this method to your ALV, search for some tutorial about event implementation.
Related
I am required to create a custom report that bulk uploads the PROJ table, that has around 8 custom fields that have been created by a Fiori app, the data to be updated would be provided as a CSV file and would have the project id for which the data has to be created.
The fields as created are visible in transaction codes CJ20N and CJ02.
The issue is that despite having the data added, the BAPI is not giving any error and no data is getting updated.
Please help me resolve this issue or suggest an alternative solution to achieve the required.
Following is my code so far, based on BAPI_PS_INITIALIZATION, BAPI_BUS2001_CHANGE, BAPI_PS_PRECOMMIT and BAPI_TRANSACTION_COMMIT:
REPORT z_bulk_proj_upload.
TYPES: BEGIN OF ty_data,
project TYPE ps_pspnr,
vip_id(18) TYPE c, "VIP ID
category(30) TYPE c, "LA Category
worktype(30) TYPE c, "LA WorkType
projtype(30) TYPE c, "LA ProjectType
region(30) TYPE c, "Region
alpharisk(20) TYPE c, "AlphaRiskControl
vipcontrol(3) TYPE c, "VIP Control
viprevised(3) TYPE c, "VIP Revised Control
majorproject(1) TYPE c, "Major Project Threshold
dateofinteg(10) TYPE c, "Date of integration
filenumber(16) TYPE c, "File Number Regie
decisiondate(10) TYPE c, "Decision Date Regie
approval(10) TYPE c, "Approval
END OF ty_data,
BEGIN OF lty_rawdata,
rawdata(40000) TYPE c,
END OF lty_rawdata.
DATA: it_data TYPE STANDARD TABLE OF ty_data,
lwa_data TYPE ty_data,
lv_file TYPE string,
it_rawdata TYPE STANDARD TABLE OF lty_rawdata,
lwa_rawdata TYPE lty_rawdata,
lr_csv TYPE REF TO cl_rsda_csv_converter,
lt_fichier TYPE filetable,
l_rc TYPE i,
lv_length TYPE i,
lv_size TYPE i,
ls_proj TYPE proj,
wa_custstr TYPE bapi_te_project_definition,
ls_project_definition TYPE bapi_bus2001_chg,
ls_project_definition_upd TYPE bapi_bus2001_upd,
lt_return TYPE STANDARD TABLE OF bapiret2,
lt_return1 TYPE bapiret2,
lt_extensionin TYPE STANDARD TABLE OF bapiparex INITIAL SIZE 0 WITH HEADER LINE.
INITIALIZATION.
CLEAR: lv_size, it_data.
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE TEXT-b05.
PARAMETERS: p_file TYPE rlgrap-filename LOWER CASE,
p_upld RADIOBUTTON GROUP grz DEFAULT 'X',
p_dwnld RADIOBUTTON GROUP grz.
SELECTION-SCREEN END OF BLOCK b4.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE TEXT-b05.
PARAMETERS: p_file TYPE rlgrap-filename LOWER CASE,
p_upld RADIOBUTTON GROUP grz DEFAULT 'X',
p_dwnld RADIOBUTTON GROUP grz.
SELECTION-SCREEN END OF BLOCK b4.
START-OF-SELECTION.
IF p_upld IS NOT INITIAL.
lv_file = p_file.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lv_file
CHANGING
data_tab = it_rawdata[]
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE 'Error in Upload' TYPE 'E'.
ELSE.
DESCRIBE TABLE it_data LINES DATA(lv_line).
ENDIF.
CALL METHOD cl_rsda_csv_converter=>create
RECEIVING
r_r_conv = lr_csv.
LOOP AT it_rawdata INTO lwa_rawdata.
TRY.
"Populate raw data into separate fields in structure
CALL METHOD lr_csv->csv_to_structure
EXPORTING
i_data = lwa_rawdata
IMPORTING
e_s_data = lwa_data.
CATCH cx_root ##CATCH_ALL.
"Error during data conversion
MESSAGE TEXT-005 TYPE 'S' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDTRY.
APPEND lwa_data TO it_data.
ENDLOOP.
ENDIF.
IF it_data IS NOT INITIAL.
LOOP AT it_data INTO lwa_data.
SELECT SINGLE * INTO ls_proj FROM proj WHERE pspid = lwa_data-project.
lt_extensionin-structure = 'BAPI_TE_PROJECT_DEFINITION'.
lt_extensionin-valuepart1+0(24) = ls_proj-pspid.
APPEND lt_extensionin.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
ls_project_definition-project_definition = ls_proj-pspid.
ls_project_definition_upd-zz1_vipid_psd = lwa_data-vip_id.
ls_project_definition_upd-zz1_lacategory_psd = lwa_data-category.
ls_project_definition_upd-zz1_laworktype_psd = lwa_data-worktype.
ls_project_definition_upd-zz1_laprojecttype_psd = lwa_data-projtype.
ls_project_definition_upd-zz1_region_psd = lwa_data-region.
ls_project_definition_upd-zz1_alphariskgrade1_psd = lwa_data-alpharisk.
ls_project_definition_upd-zz1_vipcontrolnonc_psd = lwa_data-vipcontrol.
ls_project_definition_upd-zz1_viprevisedcontroln_psd = lwa_data-viprevised.
ls_project_definition_upd-zz1_majorprojectsthres_psd = lwa_data-project.
ls_project_definition_upd-zz1_dateofintegrationi_psd = lwa_data-dateofinteg.
ls_project_definition_upd-zz1_filenumberrgie_psd = lwa_data-filenumber.
ls_project_definition_upd-zz1_decisiondatergie_psd = lwa_data-decisiondate.
ls_project_definition_upd-zz1_approval_psd = lwa_data-approval.
CALL FUNCTION 'BAPI_BUS2001_CHANGE'
EXPORTING
i_project_definition = ls_project_definition
i_project_definition_upd = ls_project_definition_upd
TABLES
et_return = lt_return.
* extensionin = lt_extensionin.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
TABLES
et_return = lt_return.
REFRESH lt_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = lt_return1.
ENDLOOP.
ENDIF.
i_project_definition is for the update flag not the actual value.
ls_project_definition-fieldxyz = 'SOME VALUE'.
ls_project_definition_upd-fieldxyz = 'X'. " should have the value 'X' !!!
the code you supplied suggests the interface was not called properly.
Furthermore for Z fields normally they are passed in via EXTENSIONIN not via
BAPI_BUS2001_CHG and BAPI_BUS2001_UPD.
FUNCTION BAPI_BUS2001_CHANGE
IMPORTING
VALUE(I_PROJECT_DEFINITION) LIKE BAPI_BUS2001_CHG
VALUE(I_PROJECT_DEFINITION_UPD) LIKE BAPI_BUS2001_UPD
TABLES
ET_RETURN LIKE BAPIRET2 OPTIONAL
EXTENSIONIN LIKE BAPIPAREX OPTIONAL "<<<<<<<<<<<<< HERE
EXTENSIONOUT LIKE BAPIPAREX OPTIONAL.
I am using the class CL_GUI_ALV_GRID and a dynpro screen to display an internal table via the ALV tool.
In my selection screen I have a dropdown list where the user can choose a layout variant for the displayed internal table. The layout variants are stored in the table LTDX.
Now, back to my question, how can I display the variants depending on the selection of the user?
You supply in the initial set_table_for_first_display method the is_variant parameter:
DATA: ls_variant TYPE disvariant.
CLEAR: ls_variant.
ls_variant-report = sy-repid.
ls_variant-variant = pa_varid. "<<< this is the name of the variant
CALL METHOD gro_alv100->set_table_for_first_display
EXPORTING
is_variant = ls_variant
...
EDIT: okay you did not accept the simple answer, so I will add the manual alternative:
FORM set_variant USING ps_variant TYPE disvariant.
DATA: lf_user_specific TYPE char1,
ls_stable TYPE lvc_s_stbl VALUE 'XX'.
CHECK ps_variant-variant IS NOT INITIAL.
lf_user_specific = boolc( ps_variant-variant(1) <> '/' ).
CALL FUNCTION 'LVC_VARIANT_SELECT'
EXPORTING
i_dialog = space
i_user_specific = lf_user_specific
i_default = space
it_default_fieldcat = gt_fcat
IMPORTING
et_fieldcat = gt_fcat
et_sort = gt_sort
et_filter = gt_filter
TABLES
it_data = gt_outtab
CHANGING
cs_variant = ps_variant
EXCEPTIONS
wrong_input = 1
fc_not_complete = 2
not_found = 3
program_error = 4
data_missing = 5
OTHERS = 6.
IF sy-subrc <> 0.
ENDIF.
gro_alv100->set_variant( EXPORTING is_variant = ps_variant ).
gro_alv100->set_frontend_fieldcatalog( EXPORTING it_fieldcatalog = gt_fcat ).
gro_alv100->set_sort_criteria( EXPORTING it_sort = gt_sort ).
gro_alv100->set_filter_criteria( EXPORTING it_filter = gt_filter ).
gro_alv100->refresh_table_display( EXPORTING is_stable = ls_stable i_soft_refresh = abap_false ).
ENDFORM.
Whenever an invalid value is entered in an ALV Grid, how do I disable the other fields (grey out) in the grid and force the user to fix the incorrect field.
I have tried adding protocol in DATA_CHANGED event. But protocol list only shows the error in popup. Editing is still possible and no fields are disabled.
But how do I disable the other fields. Sample behavior as shown below:
Here, the other fields are greyed out and the invalid entry is highlighted. Until the user fixes this error, he/she cannot proceed further.
Having screen 100 with container CCONTAINER1 paste this snippet
CLASS zcl_alv_test DEFINITION.
PUBLIC SECTION.
METHODS: constructor, display_grid, populate_grid.
DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr,
it_fldcat TYPE lvc_t_fcat,
grid_container1 TYPE REF TO cl_gui_custom_container,
grid1 TYPE REF TO cl_gui_alv_grid.
DATA: BEGIN OF gs_outtab.
INCLUDE TYPE spfli.
DATA: celltab TYPE lvc_t_styl.
DATA: END OF gs_outtab.
DATA gt_outtab1 LIKE TABLE OF gs_outtab INITIAL SIZE 0.
METHODS:
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed,
handle_data_changed_finished FOR EVENT data_changed_finished OF cl_gui_alv_grid IMPORTING e_modified et_good_cells,
create_dynamic_fcat.
PRIVATE SECTION.
TYPES: ty_tab LIKE LINE OF gt_outtab1.
METHODS: refresh_grid, fill_celltab IMPORTING p_fieldname TYPE lvc_fname
CHANGING pt_celltab TYPE lvc_t_styl.
ENDCLASS.
CLASS zcl_alv_test IMPLEMENTATION.
METHOD constructor.
CREATE OBJECT grid_container1 EXPORTING container_name = 'CCONTAINER1'.
CREATE OBJECT grid1 EXPORTING i_parent = grid_container1.
SET HANDLER handle_data_changed FOR grid1.
SET HANDLER handle_data_changed_finished FOR grid1.
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
ENDMETHOD. "constructor
METHOD fill_celltab.
LOOP AT pt_celltab ASSIGNING FIELD-SYMBOL(<fs_fcat>).
IF <fs_fcat>-fieldname = p_fieldname.
<fs_fcat>-style = cl_gui_alv_grid=>mc_style_enabled.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD handle_data_changed.
DATA: lt_celltab TYPE lvc_t_styl.
LOOP AT it_fldcat ASSIGNING FIELD-SYMBOL(<fs_fcat>).
INSERT VALUE lvc_s_styl( style = cl_gui_alv_grid=>mc_style_disabled fieldname = <fs_fcat>-fieldname ) INTO TABLE lt_celltab.
ENDLOOP.
MODIFY gt_outtab1 FROM VALUE ty_tab( celltab = lt_celltab ) TRANSPORTING celltab WHERE connid IS NOT INITIAL.
LOOP AT er_data_changed->mt_mod_cells ASSIGNING FIELD-SYMBOL(<mods>).
READ TABLE gt_outtab1 ASSIGNING FIELD-SYMBOL(<sym>) INDEX <mods>-row_id.
fill_celltab( EXPORTING p_fieldname = <mods>-fieldname
CHANGING pt_celltab = <sym>-celltab ).
MODIFY gt_outtab1 FROM <sym> INDEX <mods>-row_id.
ENDLOOP.
refresh_grid( ).
ENDMETHOD.
METHOD handle_data_changed_finished.
DATA: lt_celltab TYPE lvc_t_styl.
LOOP AT it_fldcat ASSIGNING FIELD-SYMBOL(<fs_fcat>).
IF sy-tabix MOD 2 = 0.
DATA(style) = cl_gui_alv_grid=>mc_style_disabled.
ELSE.
style = cl_gui_alv_grid=>mc_style_enabled.
ENDIF.
INSERT VALUE lvc_s_styl( style = style fieldname = <fs_fcat>-fieldname ) INTO TABLE lt_celltab.
ENDLOOP.
MODIFY gt_outtab1 FROM VALUE ty_tab( celltab = lt_celltab ) TRANSPORTING celltab WHERE connid IS NOT INITIAL.
refresh_grid( ).
ENDMETHOD.
METHOD create_dynamic_fcat.
lr_rtti_struc ?= cl_abap_structdescr=>describe_by_name( 'SPFLI' ).
DATA(comps) = lr_rtti_struc->components.
LOOP AT comps ASSIGNING FIELD-SYMBOL(<comps>).
IF sy-tabix MOD 2 = 0.
DATA(edit) = abap_false.
ELSE.
edit = abap_true.
ENDIF.
APPEND VALUE lvc_s_fcat( edit = edit fieldname = <comps>-name datatype = <comps>-type_kind inttype = <comps>-type_kind intlen = <comps>-length decimals = <comps>-decimals coltext = <comps>-name lowercase = 'X' ) TO it_fldcat .
ENDLOOP.
ENDMETHOD. "create_dynamic_fcat
METHOD populate_grid.
SELECT * UP TO 1000 ROWS
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE gt_outtab1.
ENDMETHOD. "CHANGE_TITLE
METHOD display_grid.
create_dynamic_fcat( ).
grid1->set_table_for_first_display(
EXPORTING
is_layout = VALUE lvc_s_layo( zebra = abap_true stylefname = 'CELLTAB' )
CHANGING
it_outtab = gt_outtab1
it_fieldcatalog = it_fldcat ).
ENDMETHOD. "display_grid
METHOD refresh_grid.
cl_gui_cfw=>flush( ).
grid1->refresh_table_display( ).
ENDMETHOD.
ENDCLASS.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
DATA: yalv TYPE REF TO zcl_alv_test.
CREATE OBJECT yalv.
yalv->populate_grid( ).
yalv->display_grid( ).
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'RETURN'.
LEAVE PROGRAM.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
START-OF-SELECTION.
CALL SCREEN 100.
It uses the concept of cell styles, where each row in table is assigned a table of styles for each of the column in this row. There you can apply conditional attributes on a cell level, including editability.
When throwing an error through builtin checktables/domains, the grid is made not editable except erroneous cell, and when correcting the error, editability returns.
I have set a dropdown list for an ALV Grid cell. The dropdow works fine, but it allows to enter values from the dropdown value list only. Is it possible to allow free text entry in the cell?
My ABAP code is:
Creating a value list:
DATA: lt_dropdown TYPE lvc_t_dral,
ls_dropdown TYPE lvc_s_dral.
data: ls_taba TYPE dd07v,
lt_taba TYPE STANDARD TABLE OF dd07v,
lt_tabb TYPE STANDARD TABLE OF dd07v.
CALL FUNCTION 'DD_DOMA_GET'
EXPORTING
DOMAIN_NAME = 'ZBC_TRADE_NETWORK'
LANGU = SY-LANGU
WITHTEXT = 'X'
TABLES
DD07V_TAB_A = lt_taba
DD07V_TAB_N = lt_tabb
EXCEPTIONS
ILLEGAL_VALUE = 1
OP_FAILURE = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
return.
ENDIF.
loop at lt_taba into ls_taba.
ls_dropdown-handle = '1'.
ls_dropdown-int_value = ls_taba-domvalue_l.
ls_dropdown-value = ls_taba-ddtext.
APPEND ls_dropdown TO lt_dropdown.
endloop.
*method to display the dropdown in ALV
CALL METHOD go_grid->set_drop_down_table
EXPORTING
IT_DROP_DOWN_ALIAS = lt_dropdown.
Fill the field catalogue:
data: ls_fcat type lvc_s_fcat,
lt_fcat type lvc_t_fcat.
field-symbols: <lfs_fcat> type ls_fcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = gc_struct_name
changing
ct_fieldcat = lt_fcat
exceptions
others = 1.
loop at lt_fcat assigning <lfs_fcat>.
case <lfs_fcat>-fieldname.
when 'NETWORK'.
<lfs_fcat>-drdn_hndl = '1'.
<lfs_fcat>-drdn_alias = 'X'.
<lfs_fcat>-edit = abap_on.
endcase.
endloop.
Set ALV grid for display
go_grid->set_table_for_first_display(
exporting
i_save = lf_save
i_default = lf_default
is_variant = ls_vari
is_layout = ls_layo
it_toolbar_excluding = lt_excl
changing
it_outtab = <lfs_t_data>
it_fieldcatalog = lt_fcat
exceptions
others = 1
).
No. A drop-down field implies a fixed value set. If you want to have both a value catalog and a text editing facility, use a value help (F4 help) to implement the catalog access.
I have a report that should display an attachment list from an object.
For instance, in transaction FI02 (maintenance of banks), the GOS toolbar has the menu Attachment List:
I want to display this list. What is the best way to display it?
REPORT zay_gos_demo.
DATA ls_appl_object TYPE gos_s_obj.
DATA lo_gos_api TYPE REF TO cl_gos_api.
DATA lt_attachment_list TYPE gos_t_atta.
DATA lt_role_filter TYPE gos_t_rol.
DATA ls_attachment TYPE gos_s_atta.
DATA ls_attachm_cont TYPE gos_s_attcont.
DATA ls_atta_key TYPE gos_s_attkey.
ls_appl_object-typeid = 'KNA1'.
ls_appl_object-instid = '0000000001'.
ls_appl_object-catid = 'BO'. "BO - BOR Object
"CL - Persistent Class
START-OF-SELECTION.
* create instance of GOS API providing unique application object
TRY.
lo_gos_api = cl_gos_api=>create_instance( ls_appl_object ).
* get attachment list for this object (if needed restrict selection
* by adding certain roles to filter table; initial table means: get
* attachments in all roles)
APPEND cl_gos_api=>c_attachment TO lt_role_filter.
APPEND cl_gos_api=>c_annotation TO lt_role_filter.
APPEND cl_gos_api=>c_website TO lt_role_filter.
lt_attachment_list = lo_gos_api->get_atta_list( lt_role_filter ).
CATCH cx_gos_api.
* error handling
ENDTRY.
I found other example and I want to test it:
REPORT zay_attachment_list_display.
DATA: go_attachments TYPE REF TO cl_gos_attachments,
g_att_container TYPE REF TO cl_gui_custom_container,
ls_object TYPE borident,
lo_bitem TYPE REF TO cl_sobl_bor_item.
ls_object-objtype = 'KNA1'.
ls_object-objkey = '0000000001'.
IF NOT go_attachments IS INITIAL.
CLEAR go_attachments.
ENDIF.
CREATE OBJECT g_att_container
EXPORTING
container_name = 'ATTS'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc NE 0.
* ADD your handling
ENDIF.
CREATE OBJECT lo_bitem
EXPORTING
is_bor = ls_object.
IF go_attachments IS INITIAL.
CREATE OBJECT go_attachments
EXPORTING
io_object = lo_bitem
ip_check_arl = 'X'
ip_check_bds = 'X'
io_container = g_att_container
* is_layout = ls_layout
* ip_mode = wf_mode
ip_notes = 'X'
ip_attachments = 'X'
ip_urls = 'X'.
ELSE.
go_attachments->set_container( g_att_container ).
ENDIF.
go_attachments->display( ).
I created a custom control in dynpro 0100 and I named it ATTS. I still can't get the attachment list of GOS. Did I miss something?
After weeks of searching and asking. it was really simple. just call the function GOS_ATTACHMENT_LIST_POPUP.
Example:
DATA: ls_object TYPE sibflporb,
save_request TYPE sgs_flag.
ls_object-instid = 'FR 1234567890'.
ls_object-typeid = 'BUS1011'.
ls_object-catid = 'BO'.
CALL FUNCTION 'GOS_ATTACHMENT_LIST_POPUP'
EXPORTING
is_object = ls_object
ip_mode = 'E' " Edit mode
IMPORTING
ep_save_request = save_request.
IF save_request = 'X'.
COMMIT WORK.
ENDIF.