DATA : BEGIN OF itab_tq27 OCCURS 0,
zaehler TYPE qpmk-zaehler,
mkmnr TYPE qpmk-mkmnr,
mandt TYPE mandt,
steuerkz TYPE qsteukey,
kzeinstell TYPE qseleinst.
INCLUDE STRUCTURE qmkst AS control_string.
DATA : END OF itab_tq27 .
DATA : BEGIN OF itab2 OCCURS 0,
zaehler TYPE qpmk-zaehler,
mkmnr TYPE qpmk-mkmnr.
INCLUDE STRUCTURE rqmst AS control_string2.
DATA : END OF itab2.
DATA: wa_itab LIKE LINE OF itab_tq27,
wt_itab LIKE TABLE OF itab_tq27.
DATA: wa_itab2 LIKE LINE OF itab2,
wt_itab2 LIKE TABLE OF itab2.
方法1 : 需要qs24中预设标识用到tq27的STEUERKZ值
SELECT * FROM tq27
INTO CORRESPONDING FIELDS OF TABLE itab_tq27.
SELECT * UP TO 100 ROWS
FROM qpmk.
READ TABLE itab_tq27 WITH KEY control_string = qpmk-steuerkz.
IF sy-subrc EQ 0.
WRITE : / qpmk-werks,
qpmk-mkmnr,
qpmk-loekz,
qpmk-sortfeld,
itab_tq27-steuerkz,
itab_tq27-quantitat.
ENDIF.
ENDSELECT.
方法2 : 获取qpmk-steuerkz中控制符对应的值
SELECT * UP TO 10 ROWS FROM qpmk.
wa_itab-zaehler = qpmk-zaehler.
wa_itab-mkmnr = qpmk-mkmnr.
wa_itab-control_string = qpmk-steuerkz."用qpmk中控制标识获取读与特性
APPEND wa_itab TO wt_itab.
wa_itab2-zaehler = qpmk-zaehler.
wa_itab2-mkmnr = qpmk-mkmnr.
CALL FUNCTION 'QSS0_QMKST_RQMST'
EXPORTING
qmkst_imp = wa_itab-control_string"用1的控制标识对应2中的标识"
IMPORTING
rqmst_exp = wa_itab2-control_string2."获取结果确认"
APPEND wa_itab2 TO wt_itab2.
ENDSELECT.
cl_demo_output=>write( wt_itab ).
cl_demo_output=>write( wt_itab2 ).
cl_demo_output=>display( ).
QS24获取QPMK检验主特性的详细特性
最新推荐文章于 2024-06-06 16:18:12 发布
此博客介绍了两种在SAP ABAP中处理数据的方法。方法1涉及从表tq27中选取数据,并根据qpmk-steuerkz值进行匹配,显示相关字段。方法2则通过qpmk-steuerkz控制符获取值,并使用'QSS0_QMKST_RQMST'函数模块获取结果。展示了如何在ABAP中进行数据筛选和功能调用。
摘要由CSDN通过智能技术生成