Application Development and Automation 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: 
Read only

GOS on custom program not saving links

Former Member
0 Likes
1,796

Hi all, I've just implemented GOS to a Z program following the instructions of a SDN contribution document called "How to attach documents to any custom program using GOS". I simply want to add GOS to the selection screen of the program in order to locat and store documentation regarding this Z program.

I run the program and the GOS button is displayed, I add some link or document and then I display the list of attachments and everything seems to be working ok. So when I leave the program and run it again no list of attachments is available as this is greyed out. Anyone could help please.

Steps I performed:

I created the Business object saved and released to implemented with the following:

Key -> programName (TRDIR-NAME)

and redefined the GOSAddObjects method like this:

BEGIN_METHOD GOSADDOBJECTS CHANGING CONTAINER.
DATA:
      SERVICE(255),
      BUSIDENTIFS LIKE BORIDENT OCCURS 0,
      LS_BORIDENT Type BORIDENT.

    CLEAR LS_BORIDENT.
    LS_BORIDENT-LOGSYS = SPACE.
    LS_BORIDENT-OBJTYPE = 'ZGOS'.
    LS_BORIDENT-OBJKEY  = OBJECT-KEY.
    APPEND LS_BORIDENT TO BUSIDENTIFS.


  SWC_GET_ELEMENT CONTAINER 'Service' SERVICE.
  SWC_SET_TABLE CONTAINER 'BusIdentifs' BUSIDENTIFS.
END_METHOD.

Z program:

REPORT  Z_RUBS_TEST_GOS.

CONSTANTS: OBJTYPE TYPE BORIDENT-OBJTYPE VALUE 'ZGOS'.
DATA: MANAGER TYPE REF TO CL_GOS_MANAGER,
OBJ TYPE BORIDENT.

PARAMETERS: MATNR TYPE MARA-MATNR.

AT SELECTION-SCREEN OUTPUT.

CLEAR OBJ.
* SET OBJECT TYPE TO 'ZGOS'
OBJ-OBJTYPE = OBJTYPE.
OBJ-LOGSYS  = 'OP1CLNT200'.

* SET OBJECT KEY = REPORT NAME
SELECT SINGLE NAME FROM TRDIR INTO OBJ-OBJKEY
WHERE NAME = SY-REPID.

* CALL GOS MANAGER WITHOUT CONTAINER (WILL BE DISPLAYED IN THE TOOLBAR)
CREATE OBJECT MANAGER EXPORTING
IS_OBJECT = OBJ EXCEPTIONS
OTHERS = 1.

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,118

You must add COMMIT WORK (AND WAIT or not) somewhere in your application (add a button that the user), or use CREATE OBJECT manager EXPORTING ... IP_NO_COMMIT = space or 'R' ... so that the COMMIT WORK will be done automatically by the GOS manager. Note: IP_NO_COMMIT = 'R' means that the service will start in its own LUW (using synchronous RFC).

For more information, read the [SAP Library - GOS - Publishing unique object|http://help.sap.com/saphelp_nw2004s/helpdata/EN/7e/4dbeb62c8e11d4a39e00a0c943858e/frameset.htm] (well, it doesn't talk about 'R'...)

Hi all, I've just implemented GOS to a Z program following the instructions of a SDN contribution document called "How to attach documents to any custom program using GOS". I simply want to add GOS to the selection screen of the program in order to locat and store documentation regarding this Z program.

I run the program and the GOS button is displayed, I add some link or document and then I display the list of attachments and everything seems to be working ok. So when I leave the program and run it again no list of attachments is available as this is greyed out. Anyone could help please.

Steps I performed:

I created the Business object saved and released to implemented with the following:

Key -> programName (TRDIR-NAME)

and redefined the GOSAddObjects method like this:

BEGIN_METHOD GOSADDOBJECTS CHANGING CONTAINER.
DATA:
      SERVICE(255),
      BUSIDENTIFS LIKE BORIDENT OCCURS 0,
      LS_BORIDENT Type BORIDENT.

    CLEAR LS_BORIDENT.
    LS_BORIDENT-LOGSYS = SPACE.
    LS_BORIDENT-OBJTYPE = 'ZGOS'.
    LS_BORIDENT-OBJKEY  = OBJECT-KEY.
    APPEND LS_BORIDENT TO BUSIDENTIFS.


  SWC_GET_ELEMENT CONTAINER 'Service' SERVICE.
  SWC_SET_TABLE CONTAINER 'BusIdentifs' BUSIDENTIFS.
END_METHOD.

Z program:

REPORT  Z_RUBS_TEST_GOS.

CONSTANTS: OBJTYPE TYPE BORIDENT-OBJTYPE VALUE 'ZGOS'.
DATA: MANAGER TYPE REF TO CL_GOS_MANAGER,
OBJ TYPE BORIDENT.

PARAMETERS: MATNR TYPE MARA-MATNR.

AT SELECTION-SCREEN OUTPUT.

CLEAR OBJ.
* SET OBJECT TYPE TO 'ZGOS'
OBJ-OBJTYPE = OBJTYPE.
OBJ-LOGSYS  = 'OP1CLNT200'.

* SET OBJECT KEY = REPORT NAME
SELECT SINGLE NAME FROM TRDIR INTO OBJ-OBJKEY
WHERE NAME = SY-REPID.

* CALL GOS MANAGER WITHOUT CONTAINER (WILL BE DISPLAYED IN THE TOOLBAR)
CREATE OBJECT MANAGER EXPORTING
IS_OBJECT = OBJ EXCEPTIONS
OTHERS = 1.

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,119

You must add COMMIT WORK (AND WAIT or not) somewhere in your application (add a button that the user), or use CREATE OBJECT manager EXPORTING ... IP_NO_COMMIT = space or 'R' ... so that the COMMIT WORK will be done automatically by the GOS manager. Note: IP_NO_COMMIT = 'R' means that the service will start in its own LUW (using synchronous RFC).

For more information, read the [SAP Library - GOS - Publishing unique object|http://help.sap.com/saphelp_nw2004s/helpdata/EN/7e/4dbeb62c8e11d4a39e00a0c943858e/frameset.htm] (well, it doesn't talk about 'R'...)

Read only

0 Likes
1,118

Thanks Sandra, that actually solved the problem.