Posted: Thu Jun 26, 2008 4:30 pm Post subject: Получение данных из представления v_t163k
Коллеги, подскажите. Есть представление v_t163k - account assigment categories, в котором прописаны статусы полей.
Существует ли какой-нибудь ФМ, чтобы получить статус поля по имени?
Если смотреть прямо в таблицы, статусы полей закодированы в полях
Age: 165 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Fri Jun 27, 2008 10:28 am Post subject:
Можно получить по тексту, например 'Cost Center'
Code:
* Temporary structure to determine release strategy
DATA: BEGIN OF st_cekko.
INCLUDE STRUCTURE cekko.
DATA: END OF st_cekko.
DATA: BEGIN OF i_t162x OCCURS 50,
faunr LIKE t162x-faunr,
fautx LIKE t162x-fautx,
END OF i_t162x.
DATA: v_t163k TYPE v_t163k,
rm06t TYPE rm06t,
helpchar,
offset LIKE t162x-faunr.
...
IF sy-tcode CP 'ME5+N'.
SELECT SINGLE * INTO CORRESPONDING FIELDS OF v_t163k
FROM t162k
WHERE knttp = st_cekko-knttp. "Z
IF i_t162x[] IS INITIAL.
SELECT * FROM t162x
INTO CORRESPONDING FIELDS OF TABLE i_t162x
WHERE spras = 'E' "SY-LANGU
AND fautb = '2'.
SORT i_t162x BY fautx.
ENDIF.
CLEAR: rm06t-mussf, rm06t-kannf, rm06t-anzgf, rm06t-invis.
READ TABLE i_t162x WITH KEY fautx = 'Cost Center'.
IF sy-subrc = 0.
offset = i_t162x-faunr - 1.
IF offset < 70.
helpchar = v_t163k-faus1+offset(1).
ELSEIF offset < 140.
offset = offset - 70.
helpchar = v_t163k-faus2+offset(1).
ENDIF.
CASE helpchar.
WHEN '+'. rm06t-mussf = 'X'.
WHEN '.'. rm06t-kannf = 'X'.
WHEN '*'. rm06t-anzgf = 'X'.
WHEN '-'. rm06t-invis = 'X'.
WHEN ' '. rm06t-invis = 'X'.
ENDCASE.
ENDIF.
IF NOT rm06t-invis IS INITIAL.
CLEAR st_cekko-ZKOSTL.
ENDIF.
ENDIF.
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.