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: 

Store business document Invalid partial field access: Length 0

rekha_manjunath2
Participant
0 Kudos

Hi All,

I have included a GOS object in a custom report which is a module pool program.

When I try to attach the file I get the message "Store business document  Invalid partial field access: Length 0"

What does this mean, and how do I correct this error.

I have attached the screen shot for more info.

Please Help.

Regards,

Rekha

1 ACCEPTED SOLUTION

rekha_manjunath2
Participant
0 Kudos

Please help,

Kindly suggest how to proceed on this.

Regards,

Rekha

15 REPLIES 15

rekha_manjunath2
Participant
0 Kudos

Please help,

Kindly suggest how to proceed on this.

Regards,

Rekha

0 Kudos

Hi Rekha

Can you please provide the following info..

  1. How have you enabled this functionality.. Are all the configuration in place..
  2. What is message number and class you get in it.

Nabheet

0 Kudos

Hi Nabheet,

I have used the function

*******This is in TOP*******Declarations

CONSTANTS: objtype TYPE borident-objtype VALUE 'ZHR_ADMIN'.

DATA: manager TYPE REF TO cl_gos_manager,
       obj TYPE borident,
       exclude_tab TYPE STANDARD TABLE OF exclude_type,
       exclude_wa TYPE exclude_type,
       comps type standard table of scms_comp,
       zwa_comps TYPE scms_comp.

*****This coding is written in PAI**********

WHEN 'ATTACH'.
       CALL METHOD manager->start_service_direct
         EXPORTING
           ip_service       = 'CREATE_ATTA'
           is_object        = obj
         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_object        = obj
         EXCEPTIONS
           no_object        = 1
           object_invalid   = 2
           execution_failed = 3
           OTHERS           = 4.

*********This is written in PBO********

IF manager IS INITIAL.
     obj-objtype = objtype.
     SELECT SINGLE name
     FROM trdir
     INTO obj-objkey
     WHERE name = sy-repid.


* WITH GOS TOOLBAR


     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.

     CREATE OBJECT manager
       EXPORTING
         is_object    = obj
         ip_no_commit = 'R'
       EXCEPTIONS
         others       = 1.
   ENDIF.

*****************************************************************************


By doing the above I was able to get the GOS in toolbar.

Along with this I have created object type and document type in OAC3 and OAC2 respectively.

When i create the attachment it should ask for employee number and pay group, which is not happening now.

Message number is : Message no. 00398


Regards,

Rekha

0 Kudos

Hi Rekha

If you look at your object obj you need to pass the object type and key field value..It wont ask you for it...It will directly attach the document to the key which you have passed. Try it in debugging

Nabheet

0 Kudos

Hi Nabheet,

I tried to include the object type in :-

     CREATE OBJECT manager
       EXPORTING
         is_object    = 'ZHR_ADMIN'
         ip_no_commit = 'R'
       EXCEPTIONS
         others       = 1.
   ENDIF.


but it gives an error

The literal "'ZHR_ADMIN'" is not type-compatible with the formal

parameter "IS_OBJECT".

Not knowing what to do.

Regards,

Rekha


0 Kudos

IS_OBJECT is of type BORIDENT.

IS_OBJECT-OBJKEY = 'Pass unqiue number here lets po number or whatever'.

IS_OBJECT-OBJTYPE = 'ZHR_ADMIN'

Nabheet

0 Kudos

Hi Nabheet,

Sorry to reply so late.

But I am not understanding how to pass these values and where to pass these above values. I am getting the below dump error :-  I have created an object in the name of manager.

Short text

    Invalid partial field access: Length 0

What happened?

    Error in the ABAP Application Program

    The current ABAP program "CL_ALINK_CONNECTION===========CP" had to be

     terminated because it has

    come across a statement that unfortunately cannot be executed.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_RANGE_OUT_OF_BOUNDS', was not

  caught in

procedure "CREATE_ASSIGN_EVENT" "(METHOD)", nor was it propagated by a RAISING

  clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

In the executed program "CL_ALINK_CONNECTION===========CP", the system

  attempted to access the field

"XTOAV0-OBJECT_ID" using the length 0.

However, a partial field access with the length specification 0 is not

allowed.

How to correct the error

Use a positive length specification if a part of the field "XTOAV0-OBJECT_ID"

is to be

accessed.

If the error occurred in your own ABAP program or in an SAP

program you modified, try to remove the error.

If the error occures in a non-modified SAP program, you may be able to

find an interim solution in an SAP Note.

If you have access to SAP Notes, carry out a search with the following

keywords:

"DATA_LENGTH_0" "CX_SY_RANGE_OUT_OF_BOUNDS"

"CL_ALINK_CONNECTION===========CP" or "CL_ALINK_CONNECTION===========CM006"

"CREATE_ASSIGN_EVENT"

If you cannot solve the problem yourself and want to send an error

notification to SAP, include the following information:

1. The description of the current problem (short dump)

   To save the description, choose "System->List->Save->Local File

(Unconverted)".

0 Kudos

Hi ,

Could you please give the code so that I will be able to modify the same in my program.

How to go about writing this part of code.

Regards,

Rekha

0 Kudos

Hi Rekha

I wanted you to do like as mentioned below.

IS_OBJECT is of type BORIDENT.

IS_OBJECT-OBJKEY = 'Pass unqiue number here lets po number or whatever'.

IS_OBJECT-OBJTYPE = 'ZHR_ADMIN'

CREATE OBJECT manager

       EXPORTING

         is_object    =IS_OBJECT

         ip_no_commit = ''

       EXCEPTIONS

         others       = 1.

I will advise you to go through this wonderful blog series by Naimesh to better understand what all you need to do. Specially check this

http://zevolving.com/2009/02/generic-object-services-gos-toolbar-part-3-add-toolbar-in-custom-progra...

http://zevolving.com/category/generic-object-services-gos/

Nabheet

0 Kudos

Hi Nabheet,

I have done the same :

    obj-objtype = objtype.                "'ZHR_ADMIN'
     obj-objkey  = objkey.                   " 'PERNR'


CREATE OBJECT manager
       EXPORTING

         is_object        = obj

         ip_no_commit     = space

EXCEPTIONS
         object_invalid   = 1
         callback_invalid = 2
         OTHERS  

IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
     ENDIF.


but i am getting dump


Regards,

Rekha

0 Kudos

Is this object created in SWO1..?

Nabheet

0 Kudos

hi,

yes.

0 Kudos

Hi Rekha

Your key fields/business object is still in created phase. You have put cursor on key fields then go to EDIT->change Release status-> Object type compnent to implemented for both. Then you have to put cursor on business object ZHR_ADMIN then EDIT->change Release status->Object type to implemented.

After that click on generate*CTRL+F3) then your object can be used.

Nabheet

0 Kudos

Hi Nabheet,

I think this might resolve the issue. Keeping my fingers crossed. There is some issue with our development server. So once its up, will execute and check.

Regards,

Rekha

0 Kudos

Hi Nabheet,

It worked!!! Thanks.. Working perfectly fine.

Regards,

Rekha