‎2009 Jul 21 12:00 PM
Hi ABAP-Experts,
I have created one module-pool program wid transaction.....but i am getting runtime error as " Incorrect program type with SUBMIT"
error-analysis:-- You attempted to start the ABAP/4 program "Z_MODULE_ALVOOPS_SEMIAUTO" with
SUBMIT, but the
attributes specify this program as type "M" instead of "1". You can
only start programs of type 1 with SUBMIT.
My Module pool report is as follows:-
&----
*& Module Pool Z_MODULE_ALVOOPS_SEMIAUTO
*&
&----
*&
*&
&----
PROGRAM z_module_alvoops_semiauto.
DATA : gr_alvgrid1 TYPE REF TO cl_gui_alv_grid.
DATA : container_1 TYPE REF TO cl_gui_container.
DATA : gs_layout TYPE lvc_s_layo.
DATA: gt_mara TYPE TABLE OF mara.
DATA : ls_fcat TYPE lvc_s_fcat,
gt_fcat TYPE lvc_t_fcat.
&----
*& Form call_object
&----
text
----
FORM call_object.
*SUBMIT using selection-SCREEN 0200.
CALL SELECTION-SCREEN '0500' STARTING AT 10 10 .
CALL SCREEN 0500.
PERFORM get_data.
PERFORM fill_fieldcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'MARA'
I_INTERNAL_TABNAME = 'gt_mara'
CHANGING
ct_fieldcat = gt_fcat[]
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.
CALL METHOD gr_alvgrid1->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = gt_mara
it_fieldcatalog = gt_fcat[]
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.
ENDFORM. "call_object
&----
*& Form get_data
&----
text
----
FORM get_data.
*
SELECT * FROM mara
INTO CORRESPONDING FIELDS OF TABLE gt_mara.
WHERE matnr = p_matnr.
ENDFORM. "get_data
&----
*& Form fill_fieldcat
&----
text
----
MODULE status_0500 OUTPUT.
SET PF-STATUS 'ALV-NITIN'.
SET TITLEBAR 'ALV'.
PERFORM call_object.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module USER_COMMAND_0500 INPUT
&----
text
----
MODULE user_command_0500 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR '&BCK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0500 INPUT
Please anyone suggest me proper changes
Edited by: Nitin2009 on Jul 21, 2009 1:01 PM
‎2009 Jul 21 12:13 PM
hi,
for module pool program you cant use submit.
use either call program or call transaction.
Regards
Sajid
‎2009 Jul 23 12:40 PM
Yes, u cannot use SUBMIT with module-pool program. use call transaction.
For more info on Submit and call transaction see their ABAP keyword documentation by pressing F1 on them.
‎2009 Jul 23 12:48 PM
Why would you even want to do a SUBMIT or CALL TRANSACTION? You have created a transaction for it, why not use that to start your module pool? That's what it's there for in the first place.