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

Avoiding Trailing Space Error in BW-Info Object

Former Member
0 Likes
658

Hi All,

While uploading the data in '0Material' - Info Object, there is an error raised which is related to 'Trailing Spaces Error'.

We tried with Condense statements, but still the same error is repeated.

Please suggest if any solution.

Regards,

Mohammed

1 ACCEPTED SOLUTION
Read only

gurunathkumar_dadamu
Active Contributor
0 Likes
549

Hi Rafi,

am also facing this issue,then i did following things.its working fine.create any class by defining the following method and implement as follows,

method PU_HANDLE_SPL_CHARCTER.

   DATA: lo_d_length TYPE i,

         lo_d_char(1)   TYPE c,

         lo_d_index  TYPE i.

   TRANSLATE g_object TO UPPER CASE.

   lo_d_length = STRLEN( g_object ).

*

   DO lo_d_length TIMES.

     lo_d_index = sy-index - 1.

     lo_d_char = g_object+lo_d_index(1).

     CALL FUNCTION 'RSKC_CHAVL_OF_IOBJ_CHECK'

       EXPORTING

         i_chavl           = lo_d_char

         i_iobjnm          = i_object

       EXCEPTIONS

         chavl_not_allowed = 1.

     IF sy-subrc NE 0.

       CLEAR g_object+lo_d_index(1).

     ELSE.

       g_object+lo_d_index(1) = lo_d_char.

     ENDIF.

   ENDDO.

   TRANSLATE g_object TO UPPER CASE.

endmethod.

then insert the routine in your field transformation as follows.

DATA:g_obj TYPE REF TO <Class-name what you created externally in previous step>.

CONSTANTS  c_ref TYPE /SAPDMC/LS_SRCSTR VALUE 'Info object name'. " Infoobject name

     DATA : g_object TYPE /SAPDMC/LS_SRCSTR.

     CREATE OBJECT g_obj.

     g_object = SOURCE_FIELDS-<Field>.

     CALL METHOD g_obj->pu_handle_spl_charcter

       EXPORTING

         i_object = c_ref

       CHANGING

         g_object = g_object.

     RESULT = g_object.

i hope your problem will solve.if you any issues let me know.

Regards,

Guru



3 REPLIES 3
Read only

hendrik_brandes
Contributor
0 Likes
548

Hello Rafi,

how do you load 0material? Are you using 3.x update rules or 7.x transformations?

Can you check the usage of conversion-exits?

Kind regards,

Hendrik

Read only

0 Likes
548

It is 7.x

Regards,

Mohammed

Read only

gurunathkumar_dadamu
Active Contributor
0 Likes
550

Hi Rafi,

am also facing this issue,then i did following things.its working fine.create any class by defining the following method and implement as follows,

method PU_HANDLE_SPL_CHARCTER.

   DATA: lo_d_length TYPE i,

         lo_d_char(1)   TYPE c,

         lo_d_index  TYPE i.

   TRANSLATE g_object TO UPPER CASE.

   lo_d_length = STRLEN( g_object ).

*

   DO lo_d_length TIMES.

     lo_d_index = sy-index - 1.

     lo_d_char = g_object+lo_d_index(1).

     CALL FUNCTION 'RSKC_CHAVL_OF_IOBJ_CHECK'

       EXPORTING

         i_chavl           = lo_d_char

         i_iobjnm          = i_object

       EXCEPTIONS

         chavl_not_allowed = 1.

     IF sy-subrc NE 0.

       CLEAR g_object+lo_d_index(1).

     ELSE.

       g_object+lo_d_index(1) = lo_d_char.

     ENDIF.

   ENDDO.

   TRANSLATE g_object TO UPPER CASE.

endmethod.

then insert the routine in your field transformation as follows.

DATA:g_obj TYPE REF TO <Class-name what you created externally in previous step>.

CONSTANTS  c_ref TYPE /SAPDMC/LS_SRCSTR VALUE 'Info object name'. " Infoobject name

     DATA : g_object TYPE /SAPDMC/LS_SRCSTR.

     CREATE OBJECT g_obj.

     g_object = SOURCE_FIELDS-<Field>.

     CALL METHOD g_obj->pu_handle_spl_charcter

       EXPORTING

         i_object = c_ref

       CHANGING

         g_object = g_object.

     RESULT = g_object.

i hope your problem will solve.if you any issues let me know.

Regards,

Guru