子育's profile云里雾里PhotosBlogLists Tools Help

Blog


    August 22

    F4 HELP IN SAP

    经过一晚上的努力终于解决了一个比较棘手 的小问题,呵呵。

    刚刚接手一本程序,其中涉及到了一个关于打印机的选择画面参数,本来定义的数据类型为USR01-SPLD,问题是这个数据类型对应的数据元素是RSPOPNAME:而这个数据元素拥有自己的Value table:TSP03。我们用它作为画面参数的属性的情况下,一方面,选择画面上会出现F4帮助,但是另一方面也是挺郁闷的一件事是,系统会自作主张的去做打印机数值的有效性检查。概要设计者一旦提出一个跟标准消息内容不一样的消息的话,我们就很难对应了。因为系统有自己默认的有效性检查。根本不会去理会你做的有效性检查。

    现在有效的方法恐怕就只能是自己设置打印机这个画面参数的F4帮助了。还好,SAP 自己提供了这个项目的F4 search help项目。呵呵,真是天幸。

    image

    image

    image

    REPORT  ZTEST_F4_HELP_NEW.

    PARAMETERS P_CARRID TYPE S_CARR_ID
               MATCHCODE OBJECT DEMO_F4_DE.

    PARAMETERS P_CARID1(10) TYPE C
               MATCHCODE OBJECT CU01.

    PARAMETERS P_NAME(10) TYPE C.

    PARAMETERS P_SPLD TYPE TSP03D-NAME
               MATCHCODE OBJECT PRIN.

    DATA :
       LW_DYNPROFIELD TYPE HELP_INFO-DYNPROFLD VALUE 'X',
       LW_VALUE_ORG TYPE C VALUE 'S',
       LW_ZFIELD TYPE DFIES-FIELDNAME VALUE 'USER_ADDR-BNAME'.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_NAME.
      PERFORM FRM_F4_HELP.

    *&---------------------------------------------------------------------*
    *&      Form  f4_help
    *&---------------------------------------------------------------------*
    FORM FRM_F4_HELP.

      TYPES:
        BEGIN OF TYP_DATA,
         BNAME      TYPE USER_ADDR-BNAME,
         NAME_FIRST TYPE USER_ADDR-NAME_FIRST,
         NAME_LAST  TYPE USER_ADDR-NAME_LAST,
        END OF TYP_DATA.

      DATA: LT_TABLE TYPE TABLE OF TYP_DATA .
      SELECT BNAME
             NAME_FIRST
             NAME_LAST
        INTO TABLE LT_TABLE
        FROM USER_ADDR.

      SORT LT_TABLE BY BNAME.
      DELETE  ADJACENT DUPLICATES FROM LT_TABLE.

      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD    = LW_ZFIELD
          DYNPPROG    = SY-REPID
          DYNPNR      = SY-DYNNR
          DYNPROFIELD = LW_DYNPROFIELD
          VALUE_ORG   = LW_VALUE_ORG
        TABLES
          VALUE_TAB   = LT_TABLE.

    ENDFORM.                  "FRM_F4_HELP

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://hua-ziyu.spaces.live.com/blog/cns!CDCC931FCC34F6B6!177.trak
    Weblogs that reference this entry
    • None