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

F4 help screen



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Search Help, Match Code
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Fri Jun 27, 2008 12:55 pm    Post subject: F4 help screen Reply with quote

Code:
*PROCESS ON VALUE-REQUEST.
* FIELD KNA1-KTOKD MODULES D100_F4_KTOKD.

FORM f4_ktokd.

  DATA: BEGIN OF vtab OCCURS 0,
    wert(35) TYPE c,
  END OF vtab.

  DATA:
    dfields LIKE dynpread OCCURS 0 WITH HEADER LINE,
    fields LIKE help_value OCCURS 0 WITH HEADER LINE,
    ind LIKE sy-tabix,
    rc LIKE sy-subrc.
  DATA: i_data TYPE TABLE OF kna1.

* Struktur der Tabelle definieren
  CLEAR fields.
  fields-tabname = 'KNA1'.
  fields-fieldname = 'KTOKD'.
  fields-selectflag = 'X'.
  APPEND fields.
  CLEAR fields.
  fields-tabname = 'KNA1'.
  fields-fieldname = 'KTOST'.
  APPEND fields.
  CLEAR fields.
  fields-tabname = 'KNA1T'.
  fields-fieldname = 'KTOTX'.
  APPEND fields.

* Wertetabelle fьllen
  SELECT * INTO TABLE i_data FROM kna1
  WHERE sperr = ''
  ORDER BY ktokd ktost.
  LOOP AT i_data.
* .. Kontengruppe, Steuerkz.
    vtab-wert+0(4) = i_kna1-ktokd.
    vtab-wert+4(1) = i_kna1-ktost.
* .. Text zur Kontengruppe
    SELECT SINGLE * FROM kna1t WHERE ktokd = i_data-ktokd
    AND ktost = i_data-ktost
    AND spras = sy-langu.
    IF sy-subrc <> 0. CLEAR kna1t-ktotx. ENDIF.
    vtab-wert+5(30) = kna1t-ktotx.
    APPEND vtab.
  ENDLOOP.

* erlaubte Werte anzeigen
  CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'
       EXPORTING
            selectfield                   = 'KNA1-KTOKD'
            titel                         = 'Kontengruppe auswдhlen'
            show_all_values_at_first_time = 'X'
            no_scroll                     = 'X'
            no_marking_of_checkvalue      = 'X'
            no_display_of_pers_values     = ' '
       IMPORTING
            ind                           = ind
       TABLES
            fields                        = fields
            full_table                    = vtab
       EXCEPTIONS
            full_table_empty              = 1
            no_tablestructure_given       = 2
            no_tablefields_in_dictionary  = 3
            more_then_one_selectfield     = 4
            no_selectfield                = 5
            OTHERS                        = 6.
  IF sy-subrc <> 0.
    MESSAGE e103 WITH 'HELP_VALUES_GET_NO_DD_NAME' sy-subrc.
  ENDIF.

* prьfen, ob Wert zurьckgegeben wurde
  IF ind = 0. EXIT. ENDIF.

* Struktur ZV11 anpassen
  READ TABLE i_data INDEX ind.
  skna1-ktokd = i_zvdkg-ktokd.
  skna1-ktost = i_zvdkg-ktost.
  skna1-ktotx = zvdkgt-ktotx.

* Dynpro-Felder definieren
  CLEAR dfields.
  dfields-fieldname = 'SKNA1-KTOKD'.
  dfields-fieldvalue = skna1-ktokd.
  APPEND dfields.
  CLEAR dfields.
  dfields-fieldname = 'SKNA1-KTOTX'.
  dfields-fieldvalue = kna1-ktotx.
  APPEND dfields.

* Werte auf Dynpro ausgeben
  CALL FUNCTION 'DYNP_VALUES_UPDATE'
       EXPORTING
            dyname               = sy-repid
            dynumb               = sy-dynnr
       TABLES
            dynpfields           = dfields
       EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
  IF sy-subrc <> 0.
    MESSAGE e999 WITH 'DYNP_VALUES_UPDATE' sy-subrc.
  ENDIF.

* PBO aufrufen
  LEAVE TO SCREEN sy-dynnr.

ENDFORM.                                                    " F4_KTOKD
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 -> Search Help, Match Code 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.