Posted: Tue Jul 01, 2008 12:11 pm Post subject: Field status one-time vendor
It is easy to define via customizing for most fields used in the important transactions FB01 and FB60 whether the field is editable or not.
However, it is not easy to re-obtain this information in a program at runtime, because it is NOT stored in an easily understandable database table, but via unstructured strings.
Read field status settings for one-time vendor block
IF l_ktogr IS INITIAL.
t_fields-required = 0.
t_fields-input = 1.
ELSE.
l_faus = fausw+lt_fields-offset(1).
CASE l_faus.
WHEN '+'.
t_fields-required = 1.
t_fields-input = 1.
WHEN '.'.
t_fields-required = 0.
t_fields-input = 1.
WHEN '*'.
t_fields-required = 0.
t_fields-input = 0.
WHEN '-'.
t_fields-required = 0.
t_fields-input = 0.
ENDCASE.
ENDIF.
APPEND t_fields.
ENDLOOP.
ENDFUNCTION.
*---------------------------------------------------------------------*
* FORM fill_fields *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> LT_FIELDS *
*---------------------------------------------------------------------*
FORM fill_fields TABLES lt_fields.
TYPES: BEGIN OF llty_fields,
field TYPE fieldname,
offset(2),
END OF llty_fields.
DATA: llt_fields TYPE TABLE OF llty_fields WITH HEADER LINE.
LOOP AT llt_fields.
llt_fields-offset = llt_fields-offset - 1.
MODIFY llt_fields INDEX sy-tabix.
ENDLOOP.
lt_fields[] = llt_fields[].
ENDFORM. "fill_fields
Read field status settings for account assignment block
Code:
FUNCTION z_fieldstatus_getdetail.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_BSCHL) TYPE BSCHL
*" VALUE(I_BUKRS) TYPE BUKRS
*" VALUE(I_SAKNR) TYPE SAKNR
*" TABLES
*" T_COBLF STRUCTURE COBLF
*" T_FIELDS STRUCTURE TCOBF OPTIONAL
*" EXCEPTIONS
*" ERROR_MESSAGE
*"----------------------------------------------------------------------
***
* liefert Feldstatus in Liste t_coblf:
* Feldname (DDIC) nicht in der Liste -> Feld ausgeblendet
* Feldname (DDIC) in der Liste -> Feld eingabebereit
* required = 1:
* Mussfeld;
* required = 0: kein Mussfeld
* active = 0: Feld ausgblendet
* Als Hilfstabelle wird die gesamte Feldliste der Felder (t_fields)
* ausgegeben,
* deren Eingabebereitschaft im Customizing steht
DATA: ls_faus1 LIKE tbsl-faus1.
DATA: ls_faus2 LIKE tbsl-faus2.
* Feldstatus holen
CALL FUNCTION 'FI_FIELD_SELECTION_DETERMINE'
EXPORTING
i_bschl = i_bschl
i_bukrs = i_bukrs
i_saknr = i_saknr
IMPORTING
e_faus1 = ls_faus1
e_faus2 = ls_faus2
EXCEPTIONS
customizing = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE a613(/ssc/comon).
ENDIF.
DATA lv_char.
DATA int_coblf LIKE coblf OCCURS 0 WITH HEADER LINE.
DATA p_cobl LIKE cobl.
DATA: dummy_ktosl LIKE bseg-ktosl.
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 cannot 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.