获得某个organization unit下面的所有sales org id list
生活随笔
收集整理的這篇文章主要介紹了
获得某个organization unit下面的所有sales org id list
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Created by Jerry Wang, last modified on May 15, 2015
執(zhí)行report,輸入sales org id:
輸出:
為什么50000738也包含在result list里?
因?yàn)樗矊儆贑CNEXT - 50000732
2359也同理:
?
source code:?
?
*&---------------------------------------------------------------------*?
*& Report ?ZTEST_CALL_BADI?
*&?
*&---------------------------------------------------------------------*?
*&?
*&?
*&---------------------------------------------------------------------*?
?
REPORT ZORDER_GET_SALES_ORG_LIST.?
?
PARAMETERS: org TYPE string OBLIGATORY DEFAULT 'O 50000732'.?
?
DATA: lt_search TYPE HRTB_ATTVALUE,?
ls_search LIKE LINE OF lt_search,?
lt_result TYPE HRTB_OBJKEY.?
?
ls_search-attrib = 'DIVISION'.?
ls_search-value = '02'.?
APPEND ls_search TO lt_search.?
?
ls_search-attrib = 'D_CHANNEL'.?
ls_search-value = '01'.?
APPEND ls_search TO lt_search.?
?
ls_search-attrib = 'SA_ORG'.?
ls_search-value = org.?
APPEND ls_search TO lt_search.?
?
?
CALL FUNCTION 'HR_GENAT_FIND_ATTRIBUTES'?
EXPORTING?
scenario ? ? ? ? ? ? ? ?= 'SALE'?
search_attr ? ? ? ? ? ? = lt_search?
IMPORTING?
RESULT ? ? ? ? ? ? ? ? ?= lt_result?
EXCEPTIONS?
NOTHING_FOUND ? ? ? ? ? = 1?
INVALID_SCENARIO ? ? ? ?= 2?
INVALID_ATTRIBUTE ? ? ? = 3?
INTERNAL_ERROR ? ? ? ? ?= 4?
OTHERS ? ? ? ? ? ? ? ? ?= 5?
.?
IF sy-subrc <> 0.?
WRITE: / 'attribute search failed: ' , sy-subrc.?
RETURN.?
ENDIF.?
?
LOOP AT lt_result ASSIGNING FIELD-SYMBOL(<result>).?
WRITE: / <result>-objid, ' type: ' , <result>-otype.?
ENDLOOP.總結(jié)
以上是生活随笔為你收集整理的获得某个organization unit下面的所有sales org id list的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: (转)ublox公司AGPS解决方案简介
- 下一篇: 如何显示Organization uni