Application Development 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: 

Error in this application

Former Member
0 Kudos
489

can any one clarify my doubt .... i am getting an error saying that " LFA1-LIFNR" IS UNKNOWN.

but that is there in that table... i am sending u the report coding also.... reply me soon.

REPORT Z_SB_VENDORREPORT

NO STANDARD PAGE HEADING

MESSAGE-ID ZLANCO

LINE-SIZE 120

LINE-COUNT 30(2).

**********************

  • TABLES DELARATIONS *

**********************

TABLES: LFA1,

LFM1.

******************************

  • INTERNAL TABLE DECLARATION *

******************************

DATA: BEGIN OF ITAB OCCURS 10,

LIFNR LIKE LFA1-LIFNR, " ACCOUNT NUMBER OF VENDOR OR CREDITOR

NAME1 LIKE LFA1-NAME1, " NAME

LAND1 LIKE LFA1-LAND1, " COUNTRY KEY

REGIO LIKE LFA1-REGIO, " REGION

ERDAT LIKE LFA1-ERDAT, " DATE ON WHICH THE RECORD WAS CREATED

EKORG LIKE LFM1-EKORG, " PURCHASING ORGANIZATION

WAERS LIKE LFM1-WAERS, " PURCHASE ORDER CURRENCY

EKGRP LIKE LFM1-EKGRP, " PURCHASING GROUP

MINBW LIKE LFM1-MINBW, " MINIMUM ORDER VALUE

END OF ITAB.

********************

  • SELECTION-SCREEN *

********************

SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-T01.

SELECT-OPTIONS: SLIFNR FOR LFA1-LIFNR,

SEKORG FOR LFM1-EKORG,

SEKGRP FOR LFM1-EKGRP.

SELECTION-SCREEN END OF BLOCK BLK.

***********************

  • AT SELECTION-SCREEN *

***********************

AT SELECTION-SCREEN.

SELECT SINGLE * INTO CORRESPONDING FIELDS OF ITAB

FROM LFA1 WHERE LIFNR = SLIFNR.

IF SY-SUBRC NE 0.

MESSAGE I001.

ENDIF.

***************

  • TOP-OF-PAGE *

***************

TOP-OF-PAGE.

WRITE:/40 'VENDOR DETAILS',

/40(15) SY-ULINE,

/ 'S.NO.',

10 'LIFNR',

20 'NAME1',

35 'EKORG',

45 'EKGRP',

55 'LAND1',

65 'REGIO',

75 'ERDAT',

85 'WAERS',

95 'MINBW'.

  • START-OF-SELECTION *

**********************

START-OF-SELECTION.

SELECT LFA1-LIFNR

LFA1-NAME1

LFM1-EKORG

LFM1-EKGRP

LFA1-LAND1

LFA1-REGIO

LFA1-ERDAT

LFM1-WAERS

LFM1-MINBW

INTO TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1-LIFNR = LFM1-LIFNR.

********************

  • END-OF-SELECTION *

********************

END-OF-SELECTION.

LOOP AT ITAB.

WRITE:/ ITAB-LIFNR UNDER 'LIFNR',

ITAB-NAME1 UNDER 'NAME1',

ITAB-EKORG UNDER 'EKORG',

ITAB-EKGRP UNDER 'EKGRP',

ITAB-LAND1 UNDER 'LAND1',

ITAB-REGIO UNDER 'REGIO',

ITAB-ERDAT UNDER 'ERDAT',

ITAB-WAERS UNDER 'WAERS',

ITAB-MINBW UNDER 'MINBW'.

ENDLOOP.

Thanx & Regards ,

PHANINDER GOLLAPUDI.

12 REPLIES 12

Former Member
0 Kudos
202

SLIFNR is a select-option and not a parameter.

so in your sql stement you should use


where lifnr in SLIFNR

not


lifnr = SLIFNR

if you want the = condition, use this


lifnr = slifnr-low

or


lifnr = slifnr-high

Former Member
0 Kudos
202

start of selection.

select lfa1~lifnr

......

from lfa1 innerjoin

use "~" symbol here. also

at selection-screen

SELECT SINGLE * INTO CORRESPONDING FIELDS OF ITAB

FROM LFA1 WHERE LIFNR = SLIFNR.

use IN slifnr here

Former Member
0 Kudos
202

hi,

instead of

SELECT LFA1-LIFNR

LFA1-NAME1

LFM1-EKORG

LFM1-EKGRP

LFA1-LAND1

LFA1-REGIO

LFA1-ERDAT

LFM1-WAERS

LFM1-MINBW

INTO TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1-LIFNR = LFM1-LIFNR.

write this

SELECT LFA1~LIFNR

LFA1~NAME1

LFM1~EKORG

LFM1~EKGRP

LFA1~LAND1

LFA1~REGIO

LFA1~ERDAT

LFM1~WAERS

LFM1~MINBW

INTO TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1LIFNR = LFM1LIFNR.

Message was edited by:

Dhwani shah

Former Member
0 Kudos
202

STILL I AM GETTING THE SAME ERROR --- " LFA1-LIFNR " UNKNOWN

REPLY ME

Former Member
0 Kudos
202

Hello,

In ur code part

SELECT LFA1-LIFNR

LFA1-NAME1

LFM1-EKORG

LFM1-EKGRP

LFA1-LAND1

LFA1-REGIO

LFA1-ERDAT

LFM1-WAERS

LFM1-MINBW

INTO TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1-LIFNR = LFM1-LIFNR.

<b>use ~ rather -</b>

see this corrected code

SELECT LFA1~LIFNR

LFA1~NAME1

LFM1~EKORG

LFM1~EKGRP

LFA1~LAND1

LFA1~REGIO

LFA1~ERDAT

LFM1~WAERS

LFM1~MINBW

INTO TABLE ITAB

FROM LFA1 INNER JOIN LFM1

ON LFA1LIFNR = LFM1LIFNR.

<b>Reward Points If Useful</b>

Regards, Srikanth

Former Member
0 Kudos
202

Hi phaninder:

When u use inner join, u must refer to the field from the DBT using '~' ot '-':

Mdify the select statement at start of selection. this wll solve ur prob':

SELECT LFA1~LIFNR

LFA1~NAME1

LFM1~EKORG

LFM1~EKGRP

LFA1~LAND1

LFA1~REGIO

LFA1~ERDAT

LFM1~WAERS

LFM1~MINBW

INTO TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1LIFNR = LFM1LIFNR.

*Reward pts if usefu!

Former Member
0 Kudos
202

CHANGE YOR STAR OF SELECTION

WRITE THE FOLLOWING CODE INSTEAD

  • START-OF-SELECTION *

**********************

START-OF-SELECTION.

SELECT LFA1~LIFNR

LFA1~NAME1

LFM1~EKORG

LFM1~EKGRP

LFA1~LAND1

LFA1~REGIO

LFA1~ERDAT

LFM1~WAERS

LFM1~MINBW

INTO TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1LIFNR = LFM1LIFNR.

Reward points if useful, get back in case of query...

Cheers!!!

Former Member
0 Kudos
202

STILL I AM GETTING RUN TIME ERROR .. I AM SENDING U THE DETAILS

Runtime Errors DBIF_RSQL_INVALID_RSQL

Except. CX_SY_OPEN_SQL_DB

Date and Time 19.09.2007 03:16:22

Short text

RSQL error 23 when accessing table "LFA1 ".

Missing Handling of System Exception

Program Z_SB_VENDORREPORT

Trigger Location of Exception

Program Z_SB_VENDORREPORT

Include Z_SB_VENDORREPORT

Row 80

Module Name START-OF-SELECTION

Source Code Extract

Line SourceCde

50 SELECT SINGLE * INTO CORRESPONDING FIELDS OF ITAB

51 FROM LFA1 WHERE LIFNR = SLIFNR-LOW.

52

53 IF SY-SUBRC NE 0.

54 MESSAGE I001.

55 ENDIF.

56

57 ***************

58 * TOP-OF-PAGE *

59 ***************

60 TOP-OF-PAGE.

61

62 WRITE:/40 'VENDOR DETAILS',

63 /40(15) SY-ULINE,

64 / 'S.NO.',

65 10 'LIFNR',

66 20 'NAME1',

67 35 'EKORG',

68 45 'EKGRP',

69 55 'LAND1',

70 65 'REGIO',

71 75 'ERDAT',

72 85 'WAERS',

73 95 'MINBW'.

74

75 **********************

76 * START-OF-SELECTION *

77 **********************

78 START-OF-SELECTION.

79

>>>>> SELECT LFA1~LIFNR

81 LFA1~NAME1

82 LFM1~EKORG

83 LFM1~EKGRP

84 LFA1~LAND1

85 LFA1~REGIO

86 LFA1~ERDAT

87 LFM1~WAERS

88 LFM1~MINBW

89 INTO TABLE ITAB

90 FROM LFA1

91 INNER JOIN LFM1

92 ON LFA1LIFNR = LFM1LIFNR

93 WHERE LFA1~LIFNR IN SLIFNR.

94

95 ********************

96 * END-OF-SELECTION *

97 ********************

98 END-OF-SELECTION.

99

Former Member
0 Kudos
202

helloooooo any one please solve this problem.....

0 Kudos
202

i have run this code and caught ur problem copy this code

**********************

  • START-OF-SELECTION *

**********************

START-OF-SELECTION.

SELECT LFA1~LIFNR

LFA1~NAME1

LFM1~EKORG

LFM1~EKGRP

LFA1~LAND1

LFA1~REGIO

LFA1~ERDAT

LFM1~WAERS

LFM1~MINBW

INTO corresponding fields of TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1LIFNR = LFM1LIFNR

WHERE

lfa1~LIFNR IN SLIFNR AND

LFM1~EKORG IN SEKORG and

LFM1~EKGRP in sekgrp.

Reward points if useful, get back in case of query...

Cheers!!!

Actually the problem is:

*The data read during a SELECT access could not be *inserted into the

*target field.

*Either conversion is not supported for the target *field's type or the

*target field is too short to accept the value or the *data are not in a

*form that the target field can accept

It means that the way in which your ITAB is defined and the order you have written in select query are not in same order, so either you write "INTO corresponding fields of TABLE ITAB" or you make the order of the select query same as ITAB

Message was edited by:

Tripat Pal Singh

Former Member
0 Kudos
202

hi,

i copied ur code and made some changes.

Now its not giving any error.

I cant get output as my tables dont have data.

so u try and reward me back.

**********************

  • TABLES DELARATIONS *

**********************

TABLES: LFA1,LFM1.

******************************

  • INTERNAL TABLE DECLARATION *

******************************

DATA: BEGIN OF ITAB OCCURS 10,

LIFNR LIKE LFA1-LIFNR, " ACCOUNT NUMBER OF VENDOR OR CREDITOR

NAME1 LIKE LFA1-NAME1, " NAME

LAND1 LIKE LFA1-LAND1, " COUNTRY KEY

REGIO LIKE LFA1-REGIO, " REGION

ERDAT LIKE LFA1-ERDAT, " DATE ON WHICH THE RECORD WAS CREATED

EKORG LIKE LFM1-EKORG, " PURCHASING ORGANIZATION

WAERS LIKE LFM1-WAERS, " PURCHASE ORDER CURRENCY

EKGRP LIKE LFM1-EKGRP, " PURCHASING GROUP

MINBW LIKE LFM1-MINBW, " MINIMUM ORDER VALUE

END OF ITAB.

********************

  • SELECTION-SCREEN *

********************

SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-T01.

SELECT-OPTIONS: SLIFNR FOR LFA1-LIFNR,

SEKORG FOR LFM1-EKORG,

SEKGRP FOR LFM1-EKGRP.

SELECTION-SCREEN END OF BLOCK BLK.

***********************

  • AT SELECTION-SCREEN *

***********************

AT SELECTION-SCREEN.

SELECT SINGLE * INTO CORRESPONDING FIELDS OF ITAB

FROM LFA1 WHERE LIFNR = SLIFNR.

IF SY-SUBRC NE 0.

MESSAGE I001.

ENDIF.

***************

  • TOP-OF-PAGE *

***************

TOP-OF-PAGE.

WRITE:/40 'VENDOR DETAILS',

/40(15) SY-ULINE,

/ 'S.NO.',

10 'LIFNR',

20 'NAME1',

35 'EKORG',

45 'EKGRP',

55 'LAND1',

65 'REGIO',

75 'ERDAT',

85 'WAERS',

95 'MINBW'.

**********************

  • START-OF-SELECTION *

**********************

START-OF-SELECTION.

SELECT LFA1~LIFNR

LFA1~NAME1

LFM1~EKORG

LFM1~EKGRP

LFA1~LAND1

LFA1~REGIO

LFA1~ERDAT

LFM1~WAERS

LFM1~MINBW

INTO corresponding fields of table ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1LIFNR = LFM1LIFNR where lfa1~lifnr = slifnr.

********************

  • END-OF-SELECTION *

********************

END-OF-SELECTION.

LOOP AT ITAB.

WRITE:/ ITAB-LIFNR UNDER 'LIFNR',

ITAB-NAME1 UNDER 'NAME1',

ITAB-EKORG UNDER 'EKORG',

ITAB-EKGRP UNDER 'EKGRP',

ITAB-LAND1 UNDER 'LAND1',

ITAB-REGIO UNDER 'REGIO',

ITAB-ERDAT UNDER 'ERDAT',

ITAB-WAERS UNDER 'WAERS',

ITAB-MINBW UNDER 'MINBW'.

ENDLOOP.

Former Member
0 Kudos
202

hi,

plz..... change this select query in ur program and let me know u are solved

**********************

  • START-OF-SELECTION *

**********************

START-OF-SELECTION.

SELECT LFA1~LIFNR

LFA1~NAME1

LFM1~EKORG

LFM1~EKGRP

LFA1~LAND1

LFA1~REGIO

LFA1~ERDAT

LFM1~WAERS

LFM1~MINBW

INTO TABLE ITAB

FROM LFA1

INNER JOIN LFM1

ON LFA1LIFNR = LFM1LIFNR.

regards,

karthik