2010 Mar 29 11:17 PM
Dear All,
1. I'm calling the Function Module LDB_PROCESS in my Program.
2. I'm passing CMC LDB to the above FM.
3. I've built the Necessary params to pass onto the FM.
4. But my Form is not getting triggered.
Please let me know the reason !
Enclosed is the code :
Data: wa_mastb like mastb.
SELECT-OPTIONS: s_matnr for wa_mastb-matnr.
DATA: CALLBACK TYPE TABLE OF LDBCB,
CALLBACK_WA LIKE LINE OF CALLBACK.
DATA: gt_SELTAB TYPE TABLE OF RSPARAMS,
gwa_SELTAB LIKE LINE OF gt_SELTAB.
CLEAR CALLBACK_WA.
CALLBACK_WA-LDBNODE = 'MASTB'.
CALLBACK_WA-GET = 'X'.
CALLBACK_WA-GET_LATE = ' '.
CALLBACK_WA-CB_PROG = SY-REPID.
CALLBACK_WA-CB_FORM = 'CALL_MASTB'.
APPEND CALLBACK_WA TO CALLBACK.
gwa_SELTAB-KIND = 'S'.
gwa_SELTAB-SELNAME = 'MATNR'.
Loop at s_matnr.
MOVE-CORRESPONDING s_matnr to gwa_SELTAB.
append gwa_SELTAB to gt_seltab.
endloop.
START-OF-SELECTION.
CALL FUNCTION 'LDB_PROCESS'
EXPORTING
LDBNAME = 'CMC'
* VARIANT =
* EXPRESSIONS =
* FIELD_SELECTION =
* DYN_NODE_TYPES =
TABLES
CALLBACK = CALLBACK
SELECTIONS = gt_SELTAB.
IF SY-SUBRC <> 0.
Write:/ 'Error in the Call of the LDB FM'.
ENDIF.
end-of-SELECTION.
FORM CALL_MASTB USING PD_NODE LIKE LDBN-LDBNODE
PD_WORKAREA like mastb
PD_MODE TYPE C
PD_SELECTED TYPE C.
data: ls_mastb like mastb.
CASE PD_NODE.
WHEN 'MASTB'.
LS_mastb = PD_WORKAREA.
write:/ ls_mastb-matnr, ls_mastb-werks.
ENDCASE.
ENDFORM.
Regards,
Deepu.K
.
Dear All,
1. I'm calling the Function Module LDB_PROCESS in my Program.
2. I'm passing CMC LDB to the above FM.
3. I've built the Necessary params to pass onto the FM.
4. But my Form is not getting triggered.
Please let me know the reason !
Enclosed is the code :
Data: wa_mastb like mastb.
SELECT-OPTIONS: s_matnr for wa_mastb-matnr.
DATA: CALLBACK TYPE TABLE OF LDBCB,
CALLBACK_WA LIKE LINE OF CALLBACK.
DATA: gt_SELTAB TYPE TABLE OF RSPARAMS,
gwa_SELTAB LIKE LINE OF gt_SELTAB.
CLEAR CALLBACK_WA.
CALLBACK_WA-LDBNODE = 'MASTB'.
CALLBACK_WA-GET = 'X'.
CALLBACK_WA-GET_LATE = ' '.
CALLBACK_WA-CB_PROG = SY-REPID.
CALLBACK_WA-CB_FORM = 'CALL_MASTB'.
APPEND CALLBACK_WA TO CALLBACK.
gwa_SELTAB-KIND = 'S'.
gwa_SELTAB-SELNAME = 'MATNR'.
Loop at s_matnr.
MOVE-CORRESPONDING s_matnr to gwa_SELTAB.
append gwa_SELTAB to gt_seltab.
endloop.
START-OF-SELECTION.
CALL FUNCTION 'LDB_PROCESS'
EXPORTING
LDBNAME = 'CMC'
* VARIANT =
* EXPRESSIONS =
* FIELD_SELECTION =
* DYN_NODE_TYPES =
TABLES
CALLBACK = CALLBACK
SELECTIONS = gt_SELTAB.
IF SY-SUBRC <> 0.
Write:/ 'Error in the Call of the LDB FM'.
ENDIF.
end-of-SELECTION.
FORM CALL_MASTB USING PD_NODE LIKE LDBN-LDBNODE
PD_WORKAREA like mastb
PD_MODE TYPE C
PD_SELECTED TYPE C.
data: ls_mastb like mastb.
CASE PD_NODE.
WHEN 'MASTB'.
LS_mastb = PD_WORKAREA.
write:/ ls_mastb-matnr, ls_mastb-werks.
ENDCASE.
ENDFORM.
Regards,
Deepu.K
.
2010 Mar 30 6:35 AM
Pleaseremove and try
end-of-SELECTION.
or try to use demo program DEMO_LOGICAL_DATABASE
a®
2010 Mar 30 6:48 AM
Hello A@s,
I even tried those.
The Demo Program is working fine.
The reason, what I'm thinking is: In the Demo Progrm the SFLIGHT is a table and so the Form Routine is called. But in the CMC LDB, the Table MASTB is not a physical Table and so the Form Routine is not being called.
But, anyways, I wanted this to work.
Let me know how to achieve this !
Regards,
Deepu.K
2010 Mar 30 7:22 AM
Hi!
for CMC LDB you must add parameter:
PARAMETERS :
datuv LIKE stko-datuv DEFAULT sy-datum.
and fill it
CLEAR gwa_seltab.
gwa_seltab-kind = 'P'.
gwa_seltab-selname = 'DATUV'.
gwa_seltab-sign = 'I'.
gwa_seltab-option = 'EQ'.
gwa_seltab-low = datuv .
APPEND gwa_seltab TO gt_seltab.
2011 Feb 24 3:34 PM