Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Attachments Icon in Standard Transaction like VA22

Former Member
0 Kudos
884

Hi Folks,

In standard T-code VA22, there is a provision for including attachments. This Icon is available at the Top Left Corner of the screen. This Icon is generally not available for all the users. You have to add a Parameter ID: SD_SWU_ACTIVE X Activate Workflow Box in VA22 to the user profile to get this icon in the screen. How to activate this same kind of functionality in your Z program.I want this icon and same functionality to be implemented in my custom program to add/view/delete attachments. Any pointers to this will surely help.

JLN

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos
272

you can use this FM

call function 'SWU_OBJECT_PUBLISH'

exporting

objtype = 'REPORT'

objkey = sy-repid

exceptions

objtype_not_found = 1

others = 2.

Regards

Raja

2 REPLIES 2

athavanraja
Active Contributor
0 Kudos
273

you can use this FM

call function 'SWU_OBJECT_PUBLISH'

exporting

objtype = 'REPORT'

objkey = sy-repid

exceptions

objtype_not_found = 1

others = 2.

Regards

Raja

Former Member
0 Kudos
272

you have to use an object of the class CL_GOS_MANAGER.Refer to the program below :

&----


*& Report ZGOS_SCREEN

*&

&----


*&

*&

&----


REPORT zgos_screen.

CONSTANTS :

objtype TYPE borident-objtype VALUE 'ZGOS'.

TYPES :

BEGIN OF exclude_type,

fcode LIKE rsmpe-func,

END OF exclude_type.

DATA :

manager TYPE REF TO cl_gos_manager,

obj TYPE borident,

ok_code TYPE syucomm,

fcode TYPE syucomm,

exclude_tab TYPE STANDARD TABLE OF exclude_type,

exclude_wa TYPE exclude_type.

*TOOLBAR : Display GOS toolbar in screen

*DIRECT : Call GOS services directly from screen

PARAMETERS : toolbar RADIOBUTTON GROUP gr1 DEFAULT 'X',

direct RADIOBUTTON GROUP gr1.

START-OF-SELECTION.

CALL SCREEN '0100'.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'ZGOS'.

IF manager IS INITIAL.

obj-objtype = objtype.

SELECT SINGLE name FROM trdir INTO obj-objkey

WHERE name = sy-repid.

*With GOS toolbar

IF toolbar = 'X'.

REFRESH exclude_tab[].

CLEAR : exclude_tab,exclude_wa.

MOVE 'ATTACH' TO exclude_wa-fcode.

APPEND exclude_wa TO exclude_tab.

MOVE 'LIST' TO exclude_wa-fcode.

APPEND exclude_wa TO exclude_tab.

SET PF-STATUS 'MAIN' EXCLUDING exclude_tab.

CREATE OBJECT manager

EXPORTING

  • IO_CONTAINER =

  • IS_BC_OBJECT =

is_object = obj

  • IT_SERVICE_SELECTION =

  • IO_CALLBACK =

  • IP_START_DIRECT = space

  • IP_NO_INSTANCE = space

ip_no_commit = 'R'

  • IP_MODE = 'E'

EXCEPTIONS

object_invalid = 1

callback_invalid = 2

OTHERS = 3

.

ELSE.

SET PF-STATUS 'MAIN'.

CREATE OBJECT manager

EXPORTING

  • IO_CONTAINER =

  • IS_BC_OBJECT =

  • is_object = obj

  • IT_SERVICE_SELECTION =

  • IO_CALLBACK =

  • IP_START_DIRECT = space

  • IP_NO_INSTANCE = space

ip_no_commit = 'R'

  • IP_MODE = 'E'

EXCEPTIONS

object_invalid = 1

callback_invalid = 2

OTHERS = 3

.

ENDIF.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE user_command_0100 INPUT.

fcode = ok_code.

CLEAR ok_code.

CASE fcode.

WHEN 'ATTACH'.

*Call Create Attachment Service from toolbar

CALL METHOD manager->start_service_direct

EXPORTING

ip_service = 'PCATTA_CREA'

  • IS_BC_OBJECT =

is_object = obj

  • IO_CONTAINER =

  • IP_CHECK_AVAILABLE =

  • IMPORTING

  • EP_AVAILABLE =

EXCEPTIONS

no_object = 1

object_invalid = 2

execution_failed = 3

OTHERS = 4

.

WHEN 'LIST'.

CALL METHOD manager->start_service_direct

EXPORTING

ip_service = 'VIEW_ATTA'

  • IS_BC_OBJECT =

is_object = obj

  • IO_CONTAINER =

  • IP_CHECK_AVAILABLE =

  • IMPORTING

  • EP_AVAILABLE =

EXCEPTIONS

no_object = 1

object_invalid = 2

execution_failed = 3

OTHERS = 4

.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module exit-processing INPUT

&----


  • text

----


MODULE exit-processing INPUT.

fcode = ok_code.

CLEAR ok_code.

CASE fcode.

WHEN 'BACK' OR 'EXIT' OR 'CANC'.

SET SCREEN 0.

LEAVE SCREEN.

ENDCASE.

ENDMODULE. " exit-processing INPUT