Issue for retrive data form ITAB in SAP R/3

Case:HOW CAN WE FETCH DATA FROM TRANSPARENT TABLE
scenario:calculating net price for material on sales order
(on the basis of material number,sales organization,distribution channel,division,sale to partY ,sales office)
For this 5 prices are calculated :
a)zmrp
b)zlbj
c)zmlb
d)zdij
e)mwst
A bapi is developed through which all these data are fetched using joins on transparent and pooled tables.
Bapi is properly working in Sap Environment.But when fetching data from non sap environment(.NET) only pooled tables are returning data.
Transparent tables are returning blank data.
And also if in query of transprent table if  in " where Clause " all parameters are hard codded then transparent table also return data in non sap envirnment.
for eg...
instead of writing ---
select data from tranparent table where matnr= (matnr variable made in bapi entered by user) and vkorg=(sales org  variable made in bapi) ....same with all conditions
if we write(returing data)----
select data from tranparent table where matnr='5476665987' and vkorg='1400' ....same with all conditions
BAPI Code is given below:
                                                                                FUNCTION ZBAPI_BAR3.
""Local Interface:
*"  IMPORTING
*"     VALUE(MATNR) TYPE  ZBAPI_IMPORT2-MATNR
*"     VALUE(VKORG) TYPE  ZBAPI_IMPORT2-VKORG
*"     VALUE(VTWEG) TYPE  ZBAPI_IMPORT2-VTWEG
*"     VALUE(KUNNR) TYPE  ZBAPI_IMPORT2-KUNNR
*"     VALUE(SPART) TYPE  ZBAPI_IMPORT2-SPART
*"     VALUE(AUART) TYPE  ZBAPI_IMPORT2-AUART
*"     VALUE(VKBUR) TYPE  ZBAPI_IMPORT2-VKBUR
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRETURN
*"  TABLES
*"      ITAB STRUCTURE  ZBAPI_TABLE3
  DATA: LAND1  LIKE KNA1-LAND1  ,
        REGIO  LIKE KNA1-REGIO  ,
        WERKS  LIKE VBAP-WERKS  ,
       KNUMH  LIKE A004-KNUMH  ,
               KNUMH LIKE ZBAPI_TABLE3-Knumh  ,
        KBETR   LIKE  COND_KONW-Kbetr ,
       LIKE ZBAPI_TABLE3-KBETR  ,
      KNUMH1(10) TYPE C ,
            KNUMH2(10) TYPE C ,
            KNUMH3(6) TYPE C ,
     KNUMH2 LIKE ZBAPI_TABLE3-KNUMH  ,
     KNUMH3 LIKE ZBAPI_TABLE3-KNUMH  ,
     KNUMV LIKE  ZBAPI_TABLE3-KNUMV  ,
        KDGRP  LIKE KNVV-KDGRP  ,
        TAXKD  LIKE KNVI-TAXKD  ,
        TAXM1  LIKE MLAN-TAXM1  ,
        ADRNR  LIKE TVBUR-ADRNR ,
        REGION LIKE ADRC-REGION ,
        DATE  TYPE A503-DATAB .
  SELECT SINGLE KDGRP FROM KNVV INTO KDGRP WHERE KUNNR  = KUNNR AND VKORG = VKORG AND VTWEG = VTWEG AND SPART = SPART   .
  SELECT SINGLE LAND1 REGIO  FROM KNA1 INTO (LAND1,REGIO)  WHERE KUNNR  = KUNNR .
  SELECT SINGLE WERKS FROM VBAP INNER JOIN VBAK ON VBAPVBELN = VBAKVBELN  INTO WERKS  WHERE AUART = AUART  .
  SELECT SINGLE TAXKD FROM KNVI INTO TAXKD WHERE KUNNR = KUNNR AND ALAND = LAND1 AND TATYP = 'MWST' .
  SELECT SINGLE TAXM1 FROM MLAN INTO TAXM1 WHERE MATNR = MATNR AND ALAND = LAND1  .
  SELECT SINGLE ADRNR FROM TVBUR INTO ADRNR WHERE VKBUR = VKBUR  .
  SELECT SINGLE REGION FROM ADRC INTO REGION WHERE ADDRNUMBER = ADRNR   .
  DATE = SY-DATUM .
  SELECT SINGLE KNUMH FROM A931 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'ZMRP' AND VKORG = VKORG AND VTWEG = VTWEG AND WERKS = '1410' AND KUNNR = KUNNR AND MATNR = MATNR AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE  .
SELECT SINGLE KNUMH FROM A931 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'ZMRP' AND VKORG = '1400' AND VTWEG = '10' AND WERKS = '1410' AND KUNNR = '0000100163' AND MATNR = 'A10AN027PNSL' AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE  .
  SELECT SINGLE zkarigar FROM zkari INTO KNUMH1 WHERE erdat = '20070410' .
SELECT SINGLE KNUMH FROM A004 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'ZMRP' AND VKORG = VKORG AND VTWEG = VTWEG AND MATNR = MATNR  AND DATAB LE DATE AND DATBI GE DATE  .
*'0000280050'
CLEAR KNUMH .
CLEAR KBETR .
SELECT SINGLE KNUMH FROM A503 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'MWST' AND ALAND = LAND1 AND WKREG = REGION AND REGIO = REGIO
AND TAXK1 = TAXKD  AND TAXM1 = TAXM1 AND KFRST = SPACE  AND DATAB LE DATE AND DATBI GE DATE and knumh = '0000279708'.
concatenate '0000' KNUMH into knumh1 .
**KNUMH1 = KNUMH .
**select single kbetr from konp into kbetr where knumh = knumh1 .
**knumh3 = knumh1+4(6) .
***itab-kbetr = kbetr .
**concatenate '0000' knumh3 into knumh2 .
**write:/ knumh2 .
ITAB-KNUMH1 =  KNUMH2 .
ITAB-KNUMH1 = KNUMH1 .
  APPEND ITAB .
*loop at itab .
*write:/ itab-knumh1 .
*endloop .
CLEAR KNUMH .
CLEAR KBETR .
  SELECT SINGLE KNUMH FROM A940 INTO KNUMH WHERE KAPPL = 'V' AND KSCHL = 'ZDIJ' AND VKORG = VKORG AND VTWEG = VTWEG AND KDGRP = KDGRP AND MATNR = MATNR AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE .
  SELECT SINGLE KNUMH FROM A931 INTO KNUMH WHERE KAPPL = 'V' AND KSCHL = 'ZDIJ' AND VKORG = VKORG AND VTWEG = VTWEG AND WERKS = WERKS AND KUNNR = KUNNR AND MATNR = MATNR AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE  .
ITAB-KNUMH =  KNUMH.
APPEND ITAB .
CLEAR KNUMH .
CLEAR KBETR .
ITAB-KNUMH =  KNUMH .
APPEND ITAB .
COMMIT WORK AND WAIT.
ENDFUNCTION.
Thanks & Regrds
Amrish
Advertisement
Reply

I believe you posted in the wrong forum.
This forum is dedicated to development and deployment of .Net applications that connect and interact with BusinessObjects Enterprise, BusinessObjects Edge, or Crystal Reports Server. This includes the development of applications using the BusinessObjects Enterprise, Report Application Server, Report Engine, and Web Services SDKs.
Ludek