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

FBL5N - Entries in ABAP Program

Former Member
0 Likes
4,071

Hi Experts,

We have a requirement to process a custom transaction depending on the output of FBL5N - which should include the 'Customer' fields.

We developed a ABAP program with the following lines

submit rfitemar  using selection-set 'TEST_SERV' exporting list to memory and return.

*Example Code (Retrieving list from memory)
data  begin of itab_list occurs 0.
         include structure abaplist.
data  end of itab_list.


types: begin of ty_list,
        fiiler(4),
date(10),
filler2,
doc_no(10),
filler3,
ref(16),
filler4,
billdoc(9),
filler5,
payt(4),
filler6,
ty(2),
filler7,
net_date(10),
filler8,
rcd(3),
filler9,
lcamt(12),
filler10,
lcurr(5),
filler11,
amt_doc(18),
filler12,
curr(5),
filler13,
text(35), "SGTXT
dummy(100),
       end of ty_list.

data: it_list type table of ty_list,
       wa_list type ty_list.
*data: vlist type table of string.

call function 'LIST_FROM_MEMORY'
   tables
     listobject = itab_list
   exceptions
     not_found  = 4
     others     = 8.

call function 'LIST_TO_ASCI'
   exporting
     list_index         = -1
   tables
     listasci           = it_list
     listobject         = itab_list
   exceptions
     empty_list         = 1
     list_index_invalid = 2
     others             = 3.

In the Internal Table IT_LIST we are able to get all the fields except the 'Customer  Field' -

Attached are the screen shots 1. without customer field 2. when selected the layout /SCHARGE then we are able to see the customer field in the output.

The issue is in the ABAP program we are unable to get the Customer FIeld - but when we run the transaction FBL5N - with a layout selected then we are able to see the Customer field in the output.

Please let us know if any ideas as how to get the layout value passed in the ABAP program - if any other ideas.

Regards,

Rafi


10 REPLIES 10
Read only

sai_krishna24
Active Participant
0 Likes
3,439

Check whether with customer field its crossing the line size 255. Because as i know abap list width has limitation of 255 char

Thanks

Saikrishna

Read only

0 Likes
3,439

hi Rafi

u try this link http://scn.sap.com/thread/3392862 to my post useful to you....

but you need to change in standard . 

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,439

Hi Rafi

You can pass the layout also as it is a selection screen field using

 

SUBMIT

ABCDREPORT VIA SELECTION-SCREEN WITH SELECTION-TABLE lt_rspar

exporting list to memory AND RETURN

In LT_RSPAR fill the selection screen fields along with layout

Nabheet

Read only

0 Likes
3,439

Nabheet,

Thanks for this.

What is the Type of LT_RSPAR I mean data type.

Regards,

Rafi

Read only

0 Likes
3,439

RSPARAMS... Check in help for more details

Read only

0 Likes
3,439

In selection-table I can pass the variant names of the selection screen but the output for the first time doesn't contain 'CUSTOMER' field in it - but in the out put when changed to different layout we are able to see the 'CUSTOMER' field in it.

I want to pass selection-screen parameter and layout variant from program.

I am looking for this combinations for getting the desired output.

Regards,

Rafi

Read only

0 Likes
3,439

Hi Rafi

First please save a layout in which field is visible plus other fields which you want. Then fill RSPARAMS parameters with same. It will work

can you please share your sample code

Nabheet

Read only

0 Likes
3,439

Tried as below

submit rfitemar  using selection-set 'TEST_SERV' with layout = '/SERVICECHAR'
         exporting list to memory and return.

But could get the output but not as per the layout.

Regards,

Rafi

Read only

0 Likes
3,439

Hi,

I wrote the below code for FBL3N,but it is some what similar to FBL5N.Try the below code

Check the total width length of the output.It should not cross 255 characters.

It is better to create one layout variant ( means output variant ) and pass that variant while calling your submit program.

SUBMIT FAGL_ACCOUNT_ITEMS_GL

                                  WITH SD_SAKNR IN S_SAKNR
                                  WITH SD_BUKRS IN S_BUKRS
                                  WITH X_OPSEL = SPACE
                                  WITH X_CLSEL = SPACE
                                  WITH X_AISEL = 'X'
                                  WITH SO_BUDAT IN S_BUDAT
                                  WITH PA_VARI EQ '/SALES'       "  This is the Layout Name

Regards

Bharath

Read only

0 Likes
3,439

Hi Rafi,

Were you able to solve this.

Thanks,

Anil