• ABAP 通过字段找表程序


    2.获取数据保存在哪个数据表的方法:

    1.前台对指定栏位 使用F1帮助找表,
    2.st05 跟踪业务操作过程,检索需要的数据表,(此方法找表很高效)
    3.对于文本字段找表,可以找到前台维护处,->维护长文本->表头->表名,
    4.F1某些时候找表找到的是结构,可以试着通过结构找include 组件,有找到表的可能,还可以通过相关视图去查找,(找到视图基本就能找到表)
    4.通过相关标准report / query去查找;
    5.找到对应程序,或者相应操作,使用调试+设置watchpoint 查找,
    6.通过结构 或者检查表找,
    7.通过data element ->domain ->值表,

    *&---------------------------------------------------------------------* 
    *& Report ZTABLEFIND 
    *& 
    *&---------------------------------------------------------------------* 
    *& Author: Mao JH 
    *& 
    *&---------------------------------------------------------------------*
    
    REPORT ztablefind. 
    TABLES: dd02t, dd03l, dd02l. 
    DATA: BEGIN OF field1 OCCURS 0. 
    INCLUDE STRUCTURE dd03l. 
    DATA: END OF field1. 
    DATA: BEGIN OF field2 OCCURS 0. 
    INCLUDE STRUCTURE dd03l. 
    DATA su TYPE i. 
    DATA: END OF field2. 
    DATA:field_sum TYPE i.
    
    SELECT-OPTIONS ified FOR dd03l-fieldname. 
    SELECT-OPTIONS ittype FOR dd02l-tabclass. 
    DATA fieldsum TYPE i. 
    SELECT * FROM dd03l INTO TABLE field1 WHERE fieldname IN ified. 
    SORT field1 BY tabname. 
    LOOP AT ified.
    
    fieldsum = sy-tabix. 
    ENDLOOP. 
    LOOP AT field1. 
    field_sum = field_sum + 1. 
    MOVE-CORRESPONDING field1 TO field2. 
    AT END OF tabname. 
    *field2-tabname = field1-tabname. 
    *move-corresponding field1 to field2. 
    field2-su = field_sum. 
    COLLECT field2. 
    CLEAR field2. 
    CLEAR field_sum. 
    ENDAT. 
    ENDLOOP. 
    LOOP AT field2 WHERE su = fieldsum. 
    SELECT SINGLE * FROM dd02t WHERE tabname = field2-tabname AND 
    ddlanguage = sy-langu. 
    SELECT SINGLE * FROM dd02l WHERE tabname = field2-tabname AND 
    tabclass IN ittype AND 
    as4local = field2-as4local AND 
    as4vers = field2-as4vers. 
    IF sy-subrc = 0. 
    WRITE: / field2-tabname,dd02l-tabclass,dd02t-ddtext. 
    ENDIF. 
    ENDLOOP.
  • 相关阅读:
    Unrecognized attribute 'targetFramework'.错误解决
    [译]Razor内幕之模板
    [译]Razor内幕之解析
    Java下载中文乱码问题解决方法
    获取矩形中心点与矩形外某点连线和矩形交点的算法
    做产品开发的感想
    [译]Razor内幕之表达式
    Could not find the main class. Program will exit.
    基于SAML的单点登录.NET代理端实现方案
    Linux内核虚拟内存的管理结构说明
  • 原文地址:https://www.cnblogs.com/rainysblog/p/6556853.html
Copyright © 2020-2023  润新知