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

Получение данных из представления v_t163k



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



Joined: 11 Oct 2007
Posts: 103

PostPosted: Thu Jun 26, 2008 4:30 pm    Post subject: Получение данных из представления v_t163k Reply with quote

Коллеги, подскажите. Есть представление v_t163k - account assigment categories, в котором прописаны статусы полей.
Существует ли какой-нибудь ФМ, чтобы получить статус поля по имени?

Если смотреть прямо в таблицы, статусы полей закодированы в полях
Quote:
FAUS1 = '---------+----------------------------------------+-.*-...............'
FAUS1 = ' - *'

и как их разбирать - не понятно. Sad



account_assigment_category.png
 Description:
 Filesize:  22.64 KB
 Viewed:  5049 Time(s)

account_assigment_category.png


Back to top
View user's profile Send private message
vga
Мастер
Мастер


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

PostPosted: Fri Jun 27, 2008 10:28 am    Post subject: Reply with quote

Можно получить по тексту, например '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.
Back to top
View user's profile Send private message Blog Visit poster's website
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.