SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Помогите найти ошибку SDOK_LOIO_PROPERTIES_SET



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Sed0Y
Специалист
Специалист


Age: 41
Joined: 17 Mar 2010
Posts: 88
Location: Ukraine - Kiev

PostPosted: Wed Jul 07, 2010 12:03 pm    Post subject: Помогите найти ошибку SDOK_LOIO_PROPERTIES_SET Reply with quote

Когда выполняю отчет вываливается дамб и пишет:
"Incorrect parameter with CALL FUNCTION.
This parameter was "OBJECT_ID"."

Но я не мог понять что не так

Code:
REPORT  ZBDSCHTB.

TABLES BDS_LOIO.

TYPES: BEGIN OF tabl,
    LO_CLASS  TYPE SDOK_LOCL,
    PROP01    TYPE SDOK_PRV_S,
    LOIO_ID   TYPE SDOK_LOID,
END OF tabl.

DATA:
      gt_dat TYPE TABLE OF tabl,
      wa_dat TYPE tabl.

START-OF-SELECTION.

  PERFORM GetData.

FORM GetData.

  DATA:
        p_lo_class  type sdok_locl,
        p_prop01    type sdok_prv_s,
        p_loio_id   type sdok_loid.

  data:
        it_prop type standard table of sdokpropty,
        wa_prop type sdokpropty.

  data:
        it_obj type standard table of sdokobject,
        wa_obj type sdokobject.

  SELECT * FROM BDS_LOIO INTO CORRESPONDING FIELDS OF TABLE gt_dat WHERE PROP01 <> ''.

  LOOP AT gt_dat INTO wa_dat.

    p_lo_class = wa_dat-LO_CLASS.
    p_loio_id  = wa_dat-LOIO_ID.
    p_prop01   = wa_dat-PROP01.

    TRANSLATE p_prop01 TO UPPER CASE.

    move 'DESCRIPTION' to wa_prop-name.
    move p_prop01      to wa_prop-value.
    append wa_prop to it_prop.

    move p_loio_id    to wa_obj-objid.
    move p_lo_class   to wa_obj-class.
    append wa_obj to it_obj.

    IF ( p_lo_class EQ 'BDS_LOC1' ) AND ( p_prop01 EQ 'INCOMING' OR p_prop01 EQ 'OUTGOING').
      CALL FUNCTION 'SDOK_LOIO_PROPERTIES_SET'
        IMPORTING
             OBJECT_ID               = it_obj
        TABLES
             PROPERTIES              = it_prop
        EXCEPTIONS
             NOT_EXISTING            = 1
             BAD_PROPERTIES          = 2
             NOT_AUTHORIZED          = 3
             EXCEPTION_IN_EXIT       = 4
             OTHERS                  = 5.
    ENDIF.
  ENDLOOP.
ENDFORM.
Question
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 165
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Wed Jul 07, 2010 1:07 pm    Post subject: Reply with quote

Code:
REPORT  zbdschtb.

TABLES bds_loio.

TYPES: BEGIN OF tabl,
    lo_class  TYPE sdok_locl,
    prop01    TYPE sdok_prv_s,
    loio_id   TYPE sdok_loid,
END OF tabl.

DATA:
      gt_dat TYPE TABLE OF tabl,
      wa_dat TYPE tabl.

START-OF-SELECTION.

  PERFORM getdata.

*&---------------------------------------------------------------------*
*&      Form  GetData
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM getdata.

  DATA:
        p_lo_class  TYPE sdok_locl,
        p_prop01    TYPE sdok_prv_s,
        p_loio_id   TYPE sdok_loid.

  DATA:
        it_prop_tmp TYPE STANDARD TABLE OF sdokpropty,
        it_prop TYPE STANDARD TABLE OF sdokpropty,
        wa_prop TYPE sdokpropty.

  DATA:
        it_obj TYPE STANDARD TABLE OF sdokobject,
        wa_obj TYPE sdokobject.

  SELECT * FROM bds_loio INTO CORRESPONDING FIELDS OF TABLE gt_dat WHERE prop01 <> ''.

  LOOP AT gt_dat INTO wa_dat.

    p_lo_class = wa_dat-lo_class.
    p_loio_id  = wa_dat-loio_id.
    p_prop01   = wa_dat-prop01.

    TRANSLATE p_prop01 TO UPPER CASE.

    MOVE 'DESCRIPTION' TO wa_prop-name.
    MOVE p_prop01      TO wa_prop-value.
    APPEND wa_prop TO it_prop.

    MOVE p_loio_id    TO wa_obj-objid.
    MOVE p_lo_class   TO wa_obj-class.
*    append wa_obj to it_obj.

    IF ( p_lo_class EQ 'BDS_LOC1' ) AND ( p_prop01 EQ 'INCOMING' OR p_prop01 EQ 'OUTGOING').
      CALL FUNCTION 'SDOK_LOIO_PROPERTIES_SET'
*        IMPORTING
        EXPORTING
             object_id               = wa_obj
        TABLES
             properties              = it_prop_tmp
        EXCEPTIONS
             not_existing            = 1
             bad_properties          = 2
             not_authorized          = 3
             exception_in_exit       = 4
             OTHERS                  = 5.
      IF sy-subrc IS INITIAL.
        APPEND LINES OF it_prop_tmp TO it_prop.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDFORM.                    "GetData

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
Sed0Y
Специалист
Специалист


Age: 41
Joined: 17 Mar 2010
Posts: 88
Location: Ukraine - Kiev

PostPosted: Fri Jul 09, 2010 4:36 pm    Post subject: Reply with quote

О! Чуть переделал и все работает - Большое спасибо!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.