ALV: Dropdown list individual for each line of the table
Hi
Question.. I would like to make a dropdown list for a field in the ALV list. The dropdown list is not the difficult point. But this dropdown list should be based on the line item.
Example:
Material 100.100 has plants (10, 20, 30)
Material 100.800 has plants (60, 70)
so the ALV list should show in the dropdown menu only the plants that this material has.
As I'm not sure, that my explanations are any good, here a example:
<u>
ALV-List</u>
Material Description Plants
100.100 Screwdriver (Dropdown list shows only 10,20,30)
100.800 Hammer (Dropdown list shows only 60,70).
Can anyone tell me if this is feasable? And if so how? Is it do-able with this method?
call method grid->set_drop_down_table
exporting
it_drop_down = lt_dropdown.
The program BCALV_EDIT_07 has sort of two different dropdown lists.. but I have more then two materials, there would be many lists to create.. (many drop_down_handle's)
Any other idea?
I know, this is a tricky one...
Thanks
Petra
Message was edited by:
Petra
hi
i have a code for drop down list use this
this code is for selection-screen deop-down list yu can add this same code in ALV
REPORT ZCHETANA_PRAC10 .
Type-pools: VRM.
data: name type vrm_id,
list_month type vrm_values,
list_year type vrm_values,
value type vrm_value.
selection-screen: begin of block b with frame.
parameter: p_year(10) type c as listbox visible length 10,
p_month(10) type c as listbox visible length 10.
selection-screen: end of block b.
at selection-screen output.
value-key = 'JAN'.
value-text = 'JAN'.
append value to list_month.
value-key = 'FEB'.
value-text = 'FEB'.
append value to list_month.
value-key = 'MAR'.
value-text = 'MAR'.
append value to list_month.
value-key = 'APR'.
value-text = 'APR'.
append value to list_month.
value-key = '1998'.
value-text = '1998'.
append value to list_year.
value-key = '1999'.
value-text = '1999'.
append value to list_year.
value-key = '2000'.
value-text = '2000'.
append value to list_year.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_MONTH'
VALUES = list_month
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_YEAR'
VALUES = list_year
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
start-of-selection.
write:/ p_year,
p_month.
Similar Messages
-
Different values in a list box for each row of the table control...
Dear Experts,
Is it possible to populate different values for each row in a listbox inside a table control ?
Example,
Row 1 in the the table contains A, B & C
Row 2 in the same table contains C, D & E
If yes, How?
yes i am using
call function 'VRM_SET_VALUES'
exporting
id = i_name
values = i_list.
Thank you .
Message was edited by:
Kokwei Wong
Message was edited by:
Kokwei WongHi Wong,
this is code example for listbox
TYPE-POOLS vrm .
DATA: lt_vrm_values TYPE TABLE OF vrm_value.
DATA: wa_vrm_values TYPE vrm_value.
PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
INITIALIZATION.
wa_vrm_values-key = 'Key1'.
wa_vrm_values-text = 'Value1'.
APPEND wa_vrm_values TO lt_vrm_values.
wa_vrm_values-key = 'Key2'.
wa_vrm_values-text = 'Value2'.
APPEND wa_vrm_values TO lt_vrm_values.
wa_vrm_values-key = 'Key3'.
wa_vrm_values-text = 'Value3'.
APPEND wa_vrm_values TO lt_vrm_values.
AT SELECTION-SCREEN OUTPUT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_LIST'
values = lt_vrm_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
To fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
Manas M.
P.S.: This is very easy question, you should use search ... -
Condtion based xml for each row of the table t-sql
Hello ,
i have below data.
create table #students
id int identity(1,1) primary key,
student_id int not null,
[s_m_cml] xml
insert into #students
student_id,
[s_m_xml]
values
101,
'<submarks><submark><subject>Arts</subject><marks>85</marks></submark><submark><subject>Science</subject><marks>95</marks></submark><submark><subject>maths</subject><marks>100</marks></submark></submarks>'
),(102,'<submarks><submark><subject>Arts</subject><marks>50</marks></submark><submark><subject>Science</subject><marks>75</marks></submark><submark><subject>maths</subject><marks>85</marks></submark></submarks>')
select * from #students
if all subjects- marks in s_m_xml marks > 80 then i select the row as promoted else as demoted. the exact output should look like below.
student_id [status]
101 promoted
102 demoted
what is the best way to achieve this using t-sql. Thanks in advance for any suggestions.You dont need to parse out the values from xml for this
You can do the check inline
see illustration below
drop table #students
create table #students
id int identity(1,1) primary key,
student_id int not null,
[s_m_cml] xml
insert into #students
student_id,
[s_m_cml]
values
101,
'<submarks><submark><subject>Arts</subject><marks>85</marks></submark><submark><subject>Science</subject><marks>95</marks></submark><submark><subject>maths</subject><marks>100</marks></submark></submarks>'
),(102,'<submarks><submark><subject>Arts</subject><marks>50</marks></submark><submark><subject>Science</subject><marks>75</marks></submark><submark><subject>maths</subject><marks>85</marks></submark></submarks>')
,(104,'<submarks><submark><subject>Arts</subject><marks>92</marks></submark><submark><subject>Science</subject><marks>88</marks></submark><submark><subject>maths</subject><marks>98</marks></submark></submarks>')
select *,
case when [s_m_cml].exist('/submarks/submark[data(marks) < 80]')=1 then 'demoted' else 'promoted' end as status
from #students
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Two idocs of same type for each line item
I am new to SAP PI and seeking your help in the following scenario
legacy -> SAP PI -> branched to two idocs in ECC
The scenario is that a fixed length flat file coming from Legacy wil contain some line items but each line will be a separate invoice ..the twist . since it is a financial posting each invoice(line) has to be posted twice in the same IDOC but different logics which implies that for each line in the file there will be two IDOCS created in ECC of the same type, where one would be the AR posting and the other would be the AP posting
How can i make this happen without BPM ??
I have referred to a blog 1 : n possible in PI without BPM but here it is a combination of 1:n and also splitting of the line and posting it to two IDOCS simultaneously
since the transformation logics are different will I have to create two mappings but how and where to use them ??
Can I please have someone help me with the steps in ESR ad ID
Kindly help
Thanks
RohanThanks Prateek i have done that but
" Map the occurrence of line items to the node Idoc at the target structue and then multiple idocs will be created "
is what iam unable to do
In the mapping i have to create two idocs per line item and this is creating just one
my source structure is like this
MT_abc 1.1
Invoices 1..unbounded
field 1
field 2 etc
and the target is
ACC_DOCUMENT02 1..1
IDOC 1.unbounded
and i have mapped invoices to IDOC
now for testing in the test tab of mapping
how do i test if i will have two IDOC if i get one line item ??
Edited by: RohanS on Jun 18, 2009 2:06 PM
Edited by: RohanS on Jun 18, 2009 2:08 PM -
How to restrict separate payment document for each line item in APP
HI Experts
PLs let me know how to restrict separate payment document for each line item in APP
Thanks
Sneha
Edited by: Sneha R on Apr 14, 2009 4:18 PMSneha,
If your query was to group items for payment ,in FBZP co code data for payment method there are 2 options 1.group payment for marked items 2.payment per due date.
Also in the Vendor master there is a flag which will ensure that each item is paid individually,if this is what you were looking for ( FK02 change vendor).
In case you want to group items to be paid together Payment Grouping Key can be assigned in Vendor Master .
Shony -
Fi document: different tax code for each line item
Dear All,
Our FI department needs to post FI documents by uploading the list of line items. For each line item (even when they have the same g/l account) tax code may be different from 0 to 10%. Also the tax code needs to be entered in EUR not in %. So for example they may need to post the folowing document:
PstKey Account Amount Tax amt
001 21 Vendor 95 EUR Tax amount 5 EUR
002 50 GRIR 100 EUR
003 21 Vendor 90 EUR Tax amount 10 EUR
004 50 GRIR 100 EUR
At the moment users have to post it manually. Tax rate cannot be restricted to allow tax from 0 to 10%.
Can you please advice what would be the best approach for them to make it? Providing they do want to upload the document not enter the items manually..
Thanks a lot in advance for your help!Hi,
are there some messages during this process? Upload this list in foreground batch input execution. Verify if in stop point displays any messagem. If it is the case, go to OBA5 to change its status.
Let me know results.
regards -
Using Numbers, I need to time-stamp each line in a table for when it was entered
I need to time-stamp each line in a table for when it was entered.
I have a formula which is
"=IF(F18="","",NOW())"
it gives me the answer I want, but every time I edit any data in the formula is recalculates the date/time to reflect the most recent edit. I do not want to do this. I am open to any and all solutions including using a script. I do not really know anything about scripts except that they are really easy to use once it's written.
I have a formula i use in excel but it requires circular references in excel. I tried using this formula in numbers but I get the error that says I cannot reference a cell that references back to the cell i’m inputting the formula into (circular reference. It is easy to use in excel just by limiting the # of iterations in preferences. I can’t seem to find any such preference in numbers. Do you know of one? here is the formula:
"=IF(D4=”",”",IF(B4=”",NOW(),B4))"
I use it to time stamp each line in a spreadsheet. It is the only way to keep all the previous line from recalculating everytime I add a new line. If I can’t use this formula, do you know of a way to timestamp each line without having it update everytime I add a line or edit the form?
Thanks in advance- I know this isn’t exaclty an easy question but I have honestly looked everywhere
emelyHi Emely,
Check the Insert menu:
The highlighted item is slightly misnamed, requiring a bit more than a simple selection (or keypress combination*) to act as a time stamp.
Simply choosing the menu item willproduce the result shown in A2: A time and date value is entered, but only the Date part is displayed.
Setting the cell format to Date and Time, with both parts displayed (as I've done in column B) does show both parts of the Date and Time value, but as you can see, the time part is set to midnight, as it is in any cell where you have entered only the Date part of a Date and Time value. The date was entered here in the same manner as in A3.
To enter both the current Date and current Time, the process has a few more steps:
Select the cell
Go Insert > Date & Time
Before confirming the entry, double-click the cell (now showing the Date) to open this small dialogue:
Click the pop-up menu under Choose Date format:
Choose the last item in the list.
Results as shown in A4 and B4 of the table above.
Regards,
Barry
•Regarding the KB shortcut shown: The Mac OS lets you define a KB shortcut for any top-level menu item. The one in the menu is a user-defined keypress combination, made to be easily remembered, not to be physically convenient to use. If doing your own, you may want to try for something eassier to get your fingers on. -
P.O. with different Tax codes for each line item.
Hi
I would like to know how the IV has been done for the P.O. with differnt tax codes for each line item. Since in MIRO at header level we can select only one tax code.Hi
Raju,
It means we can post only one invoice at time i.e.for line item same taxcode is there.
e.g. If line item 10 has tax code A1, 20 has A2 then on header i can only select either A1 or A2 tax code & post invoice of that line item. -
How to create an inspection lot for each line item of the Purchase order?
Hi,
How to create an inspection lot for each line item of the Purchase order ?
In detail if possible.Hi
please check this
[thread|Create Inspection Lot; -
How to get the texts for each line item for Sales order in a smartform
I'm createing a smart form in which i need to display certain texts for each line item of a sales order. How can i get those??
I'm trying with the table STXH and FM read_text... but i'm not clear how and what i'm getting... can anybody pls help me.....Hi There,
But then i will be getting only the value. i want to link that against the particular material of the Purchase Order.
Like for ex:
PO No. Material Code Line Item Basic Excise Tax Inv Value
0000001 5000251 010 100 16 4.64 120.64
0000001 5000252 020 200 32 9.28 241.28
Can u help me on this?
Regards,
Jitesh -
Creating a JButton for each line in a txt file
I need to know how to creating a JButton for each line in a txt file then add an actionListener to the number of buttons (note they are in a JTable). Here is a clipet of code thanx for the help (note that this is one part of a program i am making there are 2 more classes. If u need them just ask) Thanx:
class Diary extends JFrame implements ActionListener {
private JTextArea note;
private JTextField name;
private JMenuBar menu = new JMenuBar();
private JMenu file, edit, font, background, tcolor, settings, help;
private JMenuItem nu, copy, paste, save, exit, b8, b10, b12, b14, b16, b18, b20, b24, b30, bblue, bred, bgreen, bpink, cblue, cred, cgreen, cpink, eset, nver, using, about;
private String[] columnNames = {
"File"
private Vector dat = new Vector();
private JTable filetable;
public Diary() {
setSize(new Dimension(500, 500));
setTitle("Diary 2.00");
file = new JMenu("File");
menu.add(file);
nu = new JMenuItem("new");
nu.addActionListener(this);
file.add(nu);
file.add(new JSeparator());
copy = new JMenuItem("copy");
copy.addActionListener(this);
file.add(copy);
paste = new JMenuItem("paste");
paste.addActionListener(this);
file.add(paste);
file.add(new JSeparator());
save = new JMenuItem("Save");
save.addActionListener(this);
file.add(save);
file.add(new JSeparator());
exit = new JMenuItem("exit");
exit.addActionListener(this);
file.add(exit);
edit = new JMenu("Edit");
menu.add(edit);
font = new JMenu("font");
edit.add(font);
b8 = new JMenuItem("8");
b8.addActionListener(this);
font.add(b8);
b10 = new JMenuItem("10");
b10.addActionListener(this);
font.add(b10);
b12 = new JMenuItem("12");
b12.addActionListener(this);
font.add(b12);
b14 = new JMenuItem("14");
b14.addActionListener(this);
font.add(b14);
b16 = new JMenuItem("16");
b16.addActionListener(this);
font.add(b16);
b18 = new JMenuItem("18");
b18.addActionListener(this);
font.add(b18);
b20 = new JMenuItem("20");
b20.addActionListener(this);
font.add(b20);
b24 = new JMenuItem("24");
b24.addActionListener(this);
font.add(b24);
b30 = new JMenuItem("30");
b30.addActionListener(this);
font.add(b30);
background = new JMenu("background");
edit.add(background);
bblue = new JMenuItem("blue");
bblue.addActionListener(this);
background.add(bblue);
bred = new JMenuItem("red");
bred.addActionListener(this);
background.add(bred);
bgreen = new JMenuItem("green");
bgreen.addActionListener(this);
background.add(bgreen);
bpink = new JMenuItem("pink");
bpink.addActionListener(this);
background.add(bpink);
tcolor = new JMenu("text color");
edit.add(tcolor);
cblue = new JMenuItem("blue");
cblue.addActionListener(this);
tcolor.add(cblue);
cred = new JMenuItem("red");
cred.addActionListener(this);
tcolor.add(cred);
cgreen = new JMenuItem("green");
cgreen.addActionListener(this);
tcolor.add(cgreen);
cpink = new JMenuItem("pink");
cpink.addActionListener(this);
tcolor.add(cpink);
settings = new JMenu("Settings");
menu.add(settings);
eset = new JMenuItem("Edit Settings");
eset.addActionListener(this);
settings.add(eset);
help = new JMenu("Help");
menu.add(help);
using = new JMenuItem("Using");
using.addActionListener(this);
help.add(using);
about = new JMenuItem("About");
about.addActionListener(this);
help.add(about);
help.add(new JSeparator());
nver = new JMenuItem("new Versions");
nver.addActionListener(this);
help.add(nver);
note = new JTextArea("");
try {
BufferedReader filein = new BufferedReader(new FileReader("files.txt"));
String sfile;
while ((sfile = filein.readLine()) != null) {
//add buttons per each line of the txt file and show em
catch (FileNotFoundException ioe) {
JOptionPane.showMessageDialog(null, "Iternal Error, contact [email protected] if the error persists", "", JOptionPane.WARNING_MESSAGE);
catch (IOException ioe) {
JOptionPane.showMessageDialog(null, "Iternal Error, contact [email protected] if the error persists", "", JOptionPane.WARNING_MESSAGE);JOptionPane.showMessageDialog(null, "Iternal Error, contact [email protected] if the error persists", "", JOptionPane.WARNING_MESSAGE);
String[][] data = new String[dat.size()][];
for (int x = 0; x < dat.size(); x++) {
data[x] = (String[])dat.get(x);
filetable = new JTable(data, columnNames);
filetable.setPreferredScrollableViewportSize(new Dimension(100, 500));
JScrollPane scrollpane = new JScrollPane(filetable);
name = new JTextField("diary");
JPanel main = new JPanel(new GridLayout(0, 1));
getContentPane().add(note);
getContentPane().add(name, BorderLayout.SOUTH);
getContentPane().add(scrollpane, BorderLayout.WEST);
setJMenuBar(menu);
public void actionPerformed(ActionEvent e) {
if (e.getSource() == nu) {
int nuask = JOptionPane.showConfirmDialog(Diary.this, "Are you sure you want to make a new entry?\nThis will erease any unsaved entry's!!");
if (nuask == JOptionPane.YES_OPTION) {
note.setText("");
note.setBackground(Color.WHITE);
note.setForeground(Color.BLACK);
if (e.getSource() == copy) {
note.copy();
if (e.getSource() == paste) {
note.paste();
if (e.getSource() == save) {
try {
String sn = name.getText();
FileWriter outputStream = new FileWriter("saved/" + sn + ".txt");
setTitle("Diary 1.00 : " + sn);
outputStream.write(note.getText());
outputStream.close();
catch(IOException ioe) {
System.out.println("IOException");
if (e.getSource() == exit) {
int exitask = JOptionPane.showConfirmDialog(Diary.this, "Are you sure you want to exit? Any unsaved entries will be deleted");
if (exitask == JOptionPane.YES_OPTION) {
System.exit(0);
if (e.getSource() == b8) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),8));
if (e.getSource() == b10) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),10));
if (e.getSource() == b12) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),12));
if (e.getSource() == b14) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),14));
if (e.getSource() == b18) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),18));
if (e.getSource() == b20) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),20));
if (e.getSource() == b24) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),24));
if (e.getSource() == b30) {
note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),30));
if (e.getSource() == bblue) {
note.setBackground(Color.BLUE);
if (e.getSource() == bred) {
note.setBackground(Color.RED);
if (e.getSource() == bgreen) {
note.setBackground(Color.GREEN);
if (e.getSource() == bpink) {
note.setBackground(Color.PINK);
if (e.getSource() == cblue) {
note.setForeground(Color.BLUE);
if (e.getSource() == cred) {
note.setForeground(Color.RED);
if (e.getSource() == cgreen) {
note.setForeground(Color.GREEN);
if (e.getSource() == cpink) {
note.setForeground(Color.PINK);
if (e.getSource() == eset) {
new UserSettings().setVisible(true);
if (e.getSource() == about) {
JOptionPane.showMessageDialog(null, "Created by Collin Doering 2005 in Gr.9\n\nErrors:\n------------------------------------------------------------------\n1. No File Encryption\n2. No user and password Encryption", "", JOptionPane.INFORMATION_MESSAGE );
if (e.getSource() == nver) {
JOptionPane.showMessageDialog(null, "New Version |3.00| expected July, 2005\n\nNew Features\n----------------------------------------------\n1. File Encryption\n2. User File Encryption\n3. Full help dialog\n4. More Text changing features", "", JOptionPane.INFORMATION_MESSAGE);
if (e.getSource() == using) {
JOptionPane.showMessageDialog(null, "Go ask Collin Doering\[email protected]", "", JOptionPane.INFORMATION_MESSAGE );
THANK YOUso i still do not understand how i would create one
button per each line in a txt flle then read in the
file that the txt file specified.This assumes you know how many lines there are in the file.
If not, modify as per my prior post
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Testing extends JFrame
String[] linesInFile = {"Hello","World","Goodbye","Now"};
JButton[] btn = new JButton[linesInFile.length];
public Testing()
setLocation(200,200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JPanel jp = new JPanel(new GridLayout(0,1));
for(int x = 0; x < btn.length; x++)
btn[x] = new JButton(linesInFile[x]);//<---this would be where file.readLine() goes
jp.add(btn[x]);
btn[x].addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
JOptionPane.showMessageDialog(getContentPane(),ae.getActionCommand());}});
getContentPane().add(jp);
pack();
public static void main(String[] args){new Testing().setVisible(true);}
} -
hi,
when i post the document in migo using 311 movement type i am getting separate Tr for each line item,but i need single TR all line items , how to solve the issue.
Thanks
Muthuraman.Dhi,
thx for your answers but user mistakenly put into different movement types for each line item so different TR is created...now the problem solved.
thanks
Muthuraman.D -
Tax break up in line by line for each item in the repetitive area
Dear SAP PLD Experts
I am facing a problem for generating excise invoice in pld with tax break for each line item .
for eg : i have 5 line item in the invoice.
so , i want to show the tax break up for each line item seperately in column wise .
slNo----Item CodeQtyPriceCenvat E.Cess---- H.E.Cess-- Vat--
Total
1-- A 5 -1000 96.401.920.96 40.00--- line total
2
3
4
5
But when i am showing the Tax amount from Sales tax authorities table in repetitive area, its showing 25 line numers instead of 5 line. and tax amounts is showing line by line.
Can any body help me to sort out this issue.
Thanks
RegardsDear,
Add the UDF's on the marketing document you want the tax break up.
Apply FMS using below queries and call these UDF's on your PLD.
FOR BED
DECLARE @Amount as Numeric(19,2)
DECLARE @Rate as Numeric(19,0)
DECLARE @TAmount as Numeric(19,2)
set @TAmount =$[$38.21.Number]
SELECT @Rate=STA1.Rate
FROM OSTC INNER JOIN
STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
STA1 ON STC1.STACode = STA1.StaCode Where OSTC.Code=$[$38.160.0] And STA1.SttType='9' order by STA1.EfctDate desc
set @Amount=(@TAmount * @Rate)/100
Select @Amount
For Cess
DECLARE @Amount as Numeric(19,2)
DECLARE @Rate as Numeric(19,0)
DECLARE @TAmount as Numeric(19,2)
set @TAmount = $[$38.U_BED.Number]
SELECT @Rate=STA1.Rate
FROM OSTC INNER JOIN
STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
STA1 ON STC1.STACode = STA1.StaCode Where OSTC.Code=$[$38.160.0] And STA1.SttType='8' order by STA1.EfctDate desc
set @Amount=(@TAmount * @Rate)/100
Select @Amount
For HCess
DECLARE @Amount as Numeric(19,2)
DECLARE @Rate as Numeric(19,0)
DECLARE @TAmount as Numeric(19,2)
set @TAmount = $[$38.U_BED.Number]
SELECT @Rate=STA1.Rate
FROM OSTC INNER JOIN
STC1 ON OSTC.Code = STC1.STCCode INNER JOIN
STA1 ON STC1.STACode = STA1.StaCode Where OSTC.Code=$[$38.160.0] And STA1.SttType='10' order by STA1.EfctDate desc
set @Amount=(@TAmount * @Rate)/100
Select @Amount
This will help you.
regards,
Neetu -
Data upload:F-02: each documnet number to be generated for each line item
Dear ABAP experts,
I have a requirement.
When we uplaod customer or vendor invoices ,a document number will be generated or posted.
Similarly, my requirement is :When I do the same kind of uploads, for each line item in an excel file each document number has to be generated or posted .This upload is using Tcode: F-02.
How do I generate each document number for each line item (for each vendor or customer).
Please do the needful.Either send me a sample code or an idea how to proceed.
Thanks,
Hema.Hi,
using below code you can generate document number for each line Item.
PERFORM bdc_dynpro USING 'SAPMF05A' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
IF wa_final-field1 NE c_space.
convert date to user format
MOVE wa_final-field1 TO v_date.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = v_date
IMPORTING
ef_date = v_date1.
PERFORM bdc_field USING 'BKPF-BLDAT'
v_date1. " Document Date
Clear v_date field
CLEAR: v_date1 , v_date.
ENDIF.
PERFORM bdc_field USING 'BKPF-BLART'
wa_final-field4. " Document Type
PERFORM bdc_field USING 'BKPF-BUKRS'
wa_final-field2. " Company Code
IF wa_final-field3 NE c_space.
convert date to user format
MOVE wa_final-field3 TO v_date.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = v_date
IMPORTING
ef_date = v_date1.
PERFORM bdc_field USING 'BKPF-BUDAT'
v_date1. " Posting Date
Clear v_date field
CLEAR: v_date1 , v_date.
ENDIF.
PERFORM bdc_field USING 'BKPF-WAERS'
wa_final-field5. " Currency
PERFORM bdc_field USING 'BKPF-KURSF'
wa_final-field6. " Rate
PERFORM bdc_field USING 'BKPF-XBLNR'
wa_final-field7. " Reference
PERFORM bdc_field USING 'BKPF-BKTXT'
wa_final-field8. " Document Header Text
PERFORM bdc_field USING 'RF05A-NEWBS'
wa_final-field9. " Cr.Posting Key
PERFORM bdc_field USING 'RF05A-NEWKO'
wa_final-field10. " Cr.Vendorcode or GL Account
PERFORM bdc_dynpro USING 'SAPMF05A' '0302'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-HKONT'
wa_final-field11. " Dr.Alternative Recon A/c
PERFORM bdc_field USING 'BSEG-WRBTR'
wa_final-field12. " Dr.Amount in Document Currency
Begin of changes by someshwar
IF v_field5 NE 'jpy' OR v_field5 NE 'JPY'.
TRANSLATE v_field5 TO UPPER CASE.
IF v_field5 NE 'JPY'.
PERFORM bdc_field USING 'BSEG-DMBTR'
wa_final-field13. " Dr.Amount in Local Currency
ENDIF.
Changes end
PERFORM bdc_field USING 'BSEG-GSBER'
wa_final-field14. " Dr.Business Area
PERFORM bdc_field USING 'BSEG-ZTERM'
wa_final-field15. " Dr.Payment Terms
IF wa_final-field16 NE c_space.
convert date to user format
MOVE wa_final-field16 TO v_date.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = v_date
IMPORTING
ef_date = v_date1.
*Begin of changes by someshwar
IF wa_final-field16 NE '00000000'.
PERFORM bdc_field USING 'BSEG-ZFBDT'
v_date1. " Dr.Baseline date
ENDIF.
*Changes end
Clear v_date field
CLEAR: v_date1 , v_date.
ENDIF.
*Begin of changes by someshwar
IF wa_final-field17 NE ''.
PERFORM bdc_field USING 'BSEG-ZLSCH'
wa_final-field17. " Dr.Payment Method
ENDIF.
*changes end
PERFORM bdc_field USING 'BSEG-ZUONR'
wa_final-field18. " Dr.Assignment
PERFORM bdc_field USING 'BSEG-SGTXT'
wa_final-field19. " Dr.Text
*Perform Save posting
PERFORM save_post.
ELSE.
PERFORM bdc_dynpro USING 'SAPMF05A' '0302'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-HKONT'
wa_final-field11. " Dr.Alternative Recon A/c
PERFORM bdc_field USING 'BSEG-WRBTR'
wa_final-field12. " Dr.Amount in Document Currency
*Begin of changes by someshwar
IF v_field5 NE 'jpy' AND v_field5 NE 'JPY'.
TRANSLATE v_field5 TO UPPER CASE.
IF v_field5 NE 'JPY'.
PERFORM bdc_field USING 'BSEG-DMBTR'
wa_final-field13. " Dr.Amount in Local Currency
ENDIF.
Changes end
PERFORM bdc_field USING 'BSEG-GSBER'
wa_final-field14. " Dr.Business Area
PERFORM bdc_field USING 'BSEG-ZTERM'
wa_final-field15. " Dr.Payment Terms
IF wa_final-field16 NE c_space.
convert date to user format
MOVE wa_final-field16 TO v_date.
CALL FUNCTION '/SAPDII/SPP05_CONVERT_DATE'
EXPORTING
if_date = v_date
IMPORTING
ef_date = v_date1.
PERFORM bdc_field USING 'BSEG-ZFBDT'
v_date1. " Dr.Baseline date
ENDIF.
Clear v_date field
CLEAR: v_date1 , v_date.
ENDIF.
PERFORM bdc_field USING 'BSEG-ZLSCH'
wa_final-field17. " Dr.Payment Method
ENDIF.
PERFORM bdc_field USING 'BSEG-ZUONR'
wa_final-field18. " Dr.Assignment
PERFORM bdc_field USING 'BSEG-SGTXT'
wa_final-field19. " Dr.Text
*Perform Save posting
PERFORM bdc_field USING 'RF05A-NEWBS'
'40'. " Cr.Posting Key
PERFORM bdc_field USING 'RF05A-NEWKO'
'999996'. " Cr.Vendorcode or GL Account
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'BU'.
*& Form BDC_TRANSACTION
FORM bdc_transaction USING p_tcode.
DATA: l_v_string TYPE string.
REFRESH i_messtab.
CALL TRANSACTION p_tcode USING i_bdcdata
MODE g_mode
UPDATE 'S'
MESSAGES INTO i_messtab.
IF NOT i_messtab[] IS INITIAL.
READ TABLE i_messtab WITH KEY msgtyp = 'E'.
IF sy-subrc EQ 0.
LOOP AT i_messtab.
IF i_messtab-msgtyp = 'E'.
PERFORM fill_error_table USING i_messtab-msgtyp
i_messtab-msgid
i_messtab-msgnr
i_messtab-msgv1
i_messtab-msgv2
i_messtab-msgv3
i_messtab-msgv4.
ENDIF.
ENDLOOP.
v_error = v_error + v_count.
ENDIF.
READ TABLE i_messtab WITH KEY msgtyp = 'S' msgnr = 312.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM t100 WHERE sprsl = sy-langu
AND arbgb = i_messtab-msgid
AND msgnr = i_messtab-msgnr.
l_v_string = t100-text.
REPLACE '&' WITH i_messtab-msgv1 INTO l_v_string .
PERFORM fill_error_table USING i_messtab-msgtyp
'ZMSG_FI'
'025'
i_messtab-msgv1
wa_final2-field2
v_success = v_success + 1.
ELSE.
LOOP AT i_messtab.
IF i_messtab-msgtyp = 'S'.
PERFORM fill_error_table USING 'E'
i_messtab-msgid
i_messtab-msgnr
i_messtab-msgv1
i_messtab-msgv2
i_messtab-msgv3
i_messtab-msgv4.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
CLEAR : t100 , l_v_string .
ENDFORM. " BDC_TRANSACTION
Regards,
Siva. -
How can i show item schedule line details in Tableview for each line item
Hai all,
I need to display schedule line details in Tableview for each line item.for example in each row i need to put one column along with button , if i click on this table that row should be expand vertically and must show all schedule line details in that.if i click my button again the visible expanded row should disappear...
if anybody works on this previously plz send some sample code...
leoiz....To modify rows the best way is with the Iterator (do a search in the weblogs for "Iterator")
However for what you want to do I've only seen this really work successfully with a standard HTML table not using the tableView.
Maybe you are looking for
-
Hi SDNers, I have a requirement to write UDF, can anybody help me in acheiving the code. Requirement:- If I am getting 5 as my input to UDF, I need to generate five 001's to my output of UDF. I tried to loop the input and used result.addValue("001");
-
Add Spry Widgets to Dreamweaver Insert Bar
Hi. I'm trying to work out how to add Spry widgets to Dreamweaver's Insert bar. I downloaded Spry for Ajax 1.6 and copied the the contents of the SpryTooltip Folder. I did a search in Adobe Dreamweaver's program folder for everything Spry. I pasted S
-
I am getting 404 not found error message while sending the message from PI to HTTP application using HTTP receiver adapter. I know it is not finding the proper interface to send this message back. But I cross verified using HTTP application developer
-
Why cant we Report on transactional ODS directly?
Hi Pioneers could any one let me know the reason why we cant report on Transactional ODS directly?Why should we create an infoset for that purpose.Whats the reason? BR Ravi
-
Need suggestions for concurrent reads while deleting all entities
Hello, we need some suggestions for the following use case, as we cannot seem to find the correct transaction locking combination to meet our needs. We are using BDB JE 4.1.10, and the entityStore is transactional. In a nutshell, BDB JE is used as a