Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Archiving using PBS

Former Member
0 Likes
974

Hi All,

I have to convert all programs to fetch the archive data. For that I have yo use some PBS methods/logic to fetch archive data.

I am using the FM /PBS/SELECT_INTO_TABLE In this program I pass only one parameter then the FM is fetching the output .

when I pass two parameters to FM then the FM is still fetching the output .Which is good .

But when I passing two parameters to FM as above and one parameter I am passing wrong i.e I am passing wrong vendor # then the FM should fail to select

data.(ie) The PO 111321 has vendor # 121981, but I am passing 121982 . No data should select.

But the FM is still fetching the data. Means the FM is not working fine.

The reason is :-

In this FM the some code commented by SAP ( see the standard code below) in purchasing area ( CMM) , with which I can't query with multiple values.

standard code:-

WHEN 'CMM'.

SELECT SINGLE * FROM TFDIR "PBSL211102

WHERE FUNCNAME = '/PBS/CMM_SELECT_INTO_TABLE'. "PBSL211102

IF SY-SUBRC NE 0.

raise others. "PBSL071103

  • ist Funktionsgruppe /PBS/CMM_ACCESS vorhanden "PBSL071103

  • SELECT SINGLE * FROM TRDIR WHERE NAME = '/PBS/SAPLCMM_ACCESS'. "PBSL071103

  • IF SY-SUBRC NE 0. "PBSL071103

  • RAISE OTHERS. "PBSL071103

  • ENDIF. "PBSL071103

  • PBS-Archiv CMM "PBSL071103

  • LOOP AT SEL1TAB. "PBSY050802 "PBSL071103

  • CASE SCHL1_NAME. "PBSL071103

  • Einstieg über Name Schlüssel1 = EBELN "PBSL071103

  • WHEN 'EBELN'. "PBSL071103

  • DO. "PBSL071103

  • CALL FUNCTION '/PBS/SELECT_CMM_INTO_TABLE' "PBSL071103

  • EXPORTING "PBSL071103

  • TABNAME = TABNAME "PBSL071103

  • BELEGNR_VON = SEL1TAB-SCHLVON "PBSY050802 "PBSL071103

  • BELEGNR_BIS = SEL1TAB-SCHLBIS "PBSY050802 "PBSL071103

  • TABLES "PBSL071103

  • I_TABELLE = I_TABELLE "PBSL071103

  • EXCEPTIONS "PBSL071103

  • EOF = 1 "PBSL071103

  • OTHERS = 2. "PBSL071103

  • IF SY-SUBRC NE 0. "PBSY111202"PBSY171202 "PBSL071103

    • IF sy-subrc > 1. "PBSY111202"PBSY171202 "PBSL071103

  • EXIT. "PBSL071103

  • ENDIF. "PBSL071103

  • ENDDO. "PBSL071103

  • WHEN 'LIFNR'. "PBSL110299 "PBSL071103

  • DO. "PBSL110299 "PBSL071103

  • CALL FUNCTION '/PBS/SELECT_CMM_INTO_TABLE' "PBSL110299 "PBSL071103

  • EXPORTING "PBSL110299 "PBSL071103

  • TABNAME = TABNAME "PBSL110299 "PBSL071103

  • LIFNR_VON = SEL1TAB-SCHLVON "PBSY050802 "PBSL071103

  • LIFNR_BIS = SEL1TAB-SCHLBIS "PBSY050802 "PBSL071103

  • TABLES "PBSL110299 "PBSL071103

  • I_TABELLE = I_TABELLE "PBSL110299 "PBSL071103

  • EXCEPTIONS "PBSL110299 "PBSL071103

  • EOF = 1 "PBSL110299 "PBSL071103

  • OTHERS = 2. "PBSL110299 "PBSL071103

  • IF SY-SUBRC NE 0. "PBSL110299"PBSY111202"PBSY171202 "PBSL071103

    • IF sy-subrc > 1. "PBSL110299"PBSY111202"PBSY171202 "PBSL071103

  • EXIT. "PBSL110299 "PBSL071103

  • ENDIF. "PBSL110299 "PBSL071103

  • ENDDO. "PBSL110299 "PBSL071103

  • WHEN 'MATNR'. "PBSL070501 "PBSL071103

  • DO. "PBSL070501 "PBSL071103

  • CALL FUNCTION '/PBS/SELECT_CMM_INTO_TABLE' "PBSL070501 "PBSL071103

  • EXPORTING "PBSL070501 "PBSL071103

  • TABNAME = TABNAME "PBSL070501 "PBSL071103

  • MATNR_VON = SEL1TAB-SCHLVON "PBSY050802 "PBSL071103

  • MATNR_BIS = SEL1TAB-SCHLBIS "PBSY050802 "PBSL071103

  • TABLES "PBSL070501 "PBSL071103

  • I_TABELLE = I_TABELLE "PBSL070501 "PBSL071103

  • EXCEPTIONS "PBSL070501 "PBSL071103

  • EOF = 1 "PBSL070501 "PBSL071103

  • OTHERS = 2. "PBSL070501 "PBSL071103

  • IF SY-SUBRC NE 0. "PBSL070501"PBSY111202"PBSY171202 "PBSL071103

    • IF sy-subrc > 1. "PBSL070501"PBSY111202"PBSY171202 "PBSL071103

  • EXIT. "PBSL070501 "PBSL071103

  • ENDIF. "PBSL070501 "PBSL071103

  • ENDDO. "PBSL070501 "PBSL071103

  • ENDCASE. "PBSL071103

  • APPEND LINES OF I_TABELLE TO <TMPTAB>. "PBSY050802 "PBSL071103

  • REFRESH I_TABELLE. "PBSY050802 "PBSL071103

  • ENDLOOP. "PBSY050802 "PBSL071103

  • Komplette Tabelle zurückschreiben "PBSL071103

  • APPEND LINES OF <TMPTAB> TO I_TABELLE. "PBSY050802 "PBSL071103

  • REFRESH <TMPTAB>. "PBSL071103

  • SORT I_TABELLE. "PBSY050802 "PBSL071103

  • DELETE ADJACENT DUPLICATES FROM I_TABELLE COMPARING ALL FIELDS. "PBSL071103

  • "PBSY050802 "PBSL071103

ELSE. "PBSL211102

  • Zugriff mit neuem Funktionsbaustein "PBSL211102

LOOP AT SEL1TAB. "PBSL211102

CALL FUNCTION '/PBS/CMM_SELECT_INTO_TABLE' "PBSL211102

EXPORTING "PBSL211102

TABNAME = TABNAME "PBSL211102

SCHL1_NAME = SCHL1_NAME "PBSL211102

SCHL1_VON = SEL1TAB-SCHLVON "PBSL211102

SCHL1_BIS = SEL1TAB-SCHLBIS "PBSL211102

  • SCHL2_NAME = "PBSL211102

  • SCHL2_VON = "PBSL211102

  • SCHL2_BIS = "PBSL211102

  • SCHL3_NAME = "PBSL211102

  • SCHL3_VON = "PBSL211102

  • SCHL3_BIS = "PBSL211102

  • SCHL4_NAME = "PBSL211102

  • SCHL4_BIS = "PBSL211102

  • SCHL4_VON = "PBSL211102

  • OPTION = "PBSL211102

ANZAHL = MAX_ZAHL "PBSL211102

TABLES "PBSL211102

I_TABELLE = I_TABELLE "PBSL211102

  • SCHL1_IN = "PBSL211102

Any help in this regard will be highly appreciated....

1 REPLY 1
Read only

Former Member
0 Likes
606

I am not able to post new questions thats why want to close all questions